diff --git a/plugins/README.md b/plugins/README.md index a032883..3e66adf 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -4,13 +4,13 @@ The currently available plugins are listed below. | Plugin (a-z) | Lang | Deps | Description | | --- | --- | --- | --- | -| boom | sh | SMPlayer | Play random music from dir (modify `PLAYER`) | -| dups | sh | find, md5sum,
sort uniq xargs | List non-empty duplicate files in current directory | +| boom | sh | [moc](http://moc.daper.net/) | Play random music from dir | +| dups | sh | find, md5sum,
sort uniq xargs | List non-empty duplicate files in current dir | | checksum | sh | md5sum,
sha256sum | Create and verify checksums | | fzy-open | sh | fzy, xdg-open | Fuzzy find a file in dir subtree and edit or xdg-open | | getplugs | sh | wget | Update plugins | | hexview | sh | xxd | View a file in hex in `$PAGER` | -| imgresize | sh | [imgp](https://github.com/jarun/imgp) | Resize images in directory to screen resolution | +| imgresize | sh | [imgp](https://github.com/jarun/imgp) | Resize images in dir to screen resolution | | imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) | | ipinfo | sh | curl, whois | Fetch external IP address and whois information | | kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device | @@ -22,17 +22,17 @@ The currently available plugins are listed below. | organize | sh | file | Auto-organize files in directories by file type | | pastebin | sh | [pastebinit](https://launchpad.net/pastebinit) | Paste contents of (text) file to paste.ubuntu.com | | pdfview | sh | pdftotext/
mupdf-tools | View PDF file in `$PAGER` | -| picker | sh | nnn | Pick files and pipe the newline-separated list to another utility | +| picker | sh | nnn | Pick files and list one per line (to pipe) | | pywal | sh | pywal | Set image as wallpaper, change terminal colorscheme | | readit | sh | pdftotext, mpv,
pico2wave | Read a PDF or text file aloud | | ringtone | sh | date, ffmpeg | Create a variable bitrate mp3 ringtone from file | | splitjoin | sh | split, cat | Split file or join selection | -| sxiv | sh | sxiv | Browse images in a dir in sxiv, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts))| +| sxiv | sh | sxiv | View images in dir, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts))| | thumb | sh | [lsix](https://github.com/hackerb9/lsix) | View thumbnail of an image or dir of images | | transfer | sh | curl | Upload file to transfer.sh | -| upgrade | sh | wget | Upgrade to latest nnn version manually on Debian 9 Stretch | +| upgrade | sh | wget | Upgrade nnn manually on Debian 9 Stretch | | vidthumb | sh | [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer),
[lsix](https://github.com/hackerb9/lsix) | Show video thumbnails in terminal | -| viuimg | sh | [viu](https://github.com/atanunq/viu), less | View an image or images in a directory | +| viuimg | sh | [viu](https://github.com/atanunq/viu), less | View an image or images in dir | ## Installing plugins diff --git a/plugins/boom b/plugins/boom index ef898db..8fe0aeb 100755 --- a/plugins/boom +++ b/plugins/boom @@ -1,12 +1,32 @@ #!/usr/bin/env sh # Description: Play random music from current directory. Identifies MP3, FLAC, WEBM, WMA. -# You may want to change the PLAYER. +# You may want to set GUIPLAYER. # # Shell: POSIX compliant # Author: Arun Prakash Jana -PLAYER=smplayer +#GUIPLAYER=smplayer -find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" "$PLAYER" > /dev/null 2>&1 & -disown +if [ ! -z "$GUIPLAYER" ]; then + PLAYER="$GUIPLAYER" + find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" "$PLAYER" > /dev/null 2>&1 & + + # detach the player + disown +else + # exit MOC server + mocp -x + + # start MOC server + mocp -S + + # clear MOC playlist + mocp -c + + # add up to 100 random audio files + find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n 100 | xargs -d "\n" mocp -a + + # start playing + mocp -p +fi