]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix plugin boom, make customizable
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 25 Aug 2019 00:46:31 +0000 (06:16 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 25 Aug 2019 00:47:05 +0000 (06:17 +0530)
plugins/boom

index 8fe0aeb9cb0e359a68df74d738d07d82a711a3d7..47036e0e7e6634d3dfca99562fa61481fc482639 100755 (executable)
@@ -8,16 +8,15 @@
 
 #GUIPLAYER=smplayer
 
+NUMTRACKS=100
+
 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 &
+    find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n $NUMTRACKS | xargs -d "\n" "$PLAYER" > /dev/null 2>&1 &
 
     # detach the player
     disown
 else
-    # exit MOC server
-    mocp -x
-
     # start MOC server
     mocp -S
 
@@ -25,7 +24,7 @@ else
     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
+    find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.webm" -o -iname "*.wma" \) | sort -R | head -n $NUMTRACKS | xargs -d "\n" mocp -a
 
     # start playing
     mocp -p