]> Sergey Matveev's repositories - nnn.git/commitdiff
Plugin music: play random music from current dir
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 20 Apr 2019 12:13:13 +0000 (17:43 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 20 Apr 2019 12:42:52 +0000 (18:12 +0530)
plugins/README.md
plugins/boom [new file with mode: 0755]
plugins/ipinfo

index 0fa28ddbfbebf2c0a883939ac7ab304f03e35576..9877563856878f802d726b1769fab98f54f4c02e 100644 (file)
@@ -1,5 +1,6 @@
 | Plugin (a-z) | Lang | Deps | Description |
 | --- | --- | --- | --- |
+| boom | sh | SMPlayer | Play random music from current dir (modify `PLAYER`) |
 | fzy-edit | sh | fzy | Fuzzy find a file in directory subtree and edit in vim |
 | fzy-open | sh | fzy | Fuzzy find a file in directory subtree and open using xdg-open |
 | getplugs | sh | wget | Update plugins |
diff --git a/plugins/boom b/plugins/boom
new file mode 100755 (executable)
index 0000000..ef898db
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env sh
+
+# Description: Play random music from current directory. Identifies MP3, FLAC, WEBM, WMA.
+#              You may want to change the PLAYER.
+#
+# Shell: POSIX compliant
+# Author: Arun Prakash Jana
+
+PLAYER=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
index 9ee1ca9062730fd4215e50ff81771222549645b5..b743df891db2fe8adaa49a4796b5e4898de77c5f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 
-# Description: Shows the IP address and whois information.
+# Description: Shows the IP address and whois information. Useful over VPNs.
 #
 # Shell: POSIX compliant
 # Author: Arun Prakash Jana