]> Sergey Matveev's repositories - nnn.git/commitdiff
Update mocplay to understand opener calls
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 23 Feb 2020 09:53:39 +0000 (15:23 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 23 Feb 2020 09:59:21 +0000 (15:29 +0530)
plugins/mocplay
plugins/mp3conv
plugins/nuke

index 211a3db5fe43bbaa846a831d5ad788d5496b1843..30818b29688348814875e087fc48bf695b797bbc 100755 (executable)
@@ -57,7 +57,9 @@ if [ ! -s "$selection" ] && [ -z "$1" ]; then
    exit
 fi
 
-if [ -s "$selection" ]; then
+if [ "$2" = "opener" ]; then
+    :
+elif [ -s "$selection" ]; then
     printf "Work with selection? Enter 'y' to confirm: "
     read -r resp
 fi
index 1c0090978256970f7602f65fa94dccdef5f8f624..b582cbca0dc6dd2389d07fa05795e865e416f51d 100755 (executable)
@@ -15,7 +15,7 @@ handle_multimedia() {
 
     case "${mime}" in
         audio/* | video/*)
-            ffmpeg -i "${file}" -vn -codec:a libmp3lame -q:a 2 "${outdir}"/"${file%.*}.mp3"
+            ffmpeg -i "${file}" -vn -codec:a libmp3lame -q:a 2 "${outdir}/${file%.*}.mp3"
             ;;
         *)
             ;;
index 9487780ea46f60b16a019f4fb911560f297b1809..604777b0aad8becf80f639bf8423dc7a14af3e6a 100755 (executable)
@@ -99,8 +99,8 @@ handle_pdf() {
 }
 
 handle_audio() {
-    if which mocp >/dev/null 2>&1; then
-        mocplay "${FPATH}" >/dev/null 2>&1
+    if which mocplay >/dev/null 2>&1; then
+        mocplay "${FPATH}" "opener" >/dev/null 2>&1
         exit 0
     elif which mpv >/dev/null 2>&1; then
         mpv "${FPATH}" >/dev/null 2>&1 &