diff options
| author | 2019-09-16 23:35:43 +0530 | |
|---|---|---|
| committer | 2019-09-16 23:35:43 +0530 | |
| commit | b5ed36bebee7d4b087924791cb8b629523036c51 (patch) | |
| tree | 2e5c15e4c21771e9f822843ecb1a67715e54ca27 /plugins | |
| parent | 450601bea57e0308300ad23c5b39e66dad2a4469 (diff) | |
| download | nnn-b5ed36bebee7d4b087924791cb8b629523036c51.tar.gz | |
mocplay: confirm working with selection
Diffstat (limited to 'plugins')
| -rwxr-xr-x | plugins/mocplay | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/mocplay b/plugins/mocplay index d93536a..5f37c37 100755 --- a/plugins/mocplay +++ b/plugins/mocplay @@ -20,7 +20,7 @@ SHUFFLE=0 mocp_add() { if [ $SHUFFLE = 1 ]; then - if [ -s "$selection" ]; then + if [ "$resp" = "y" ]; then arr=$(tr '\0' '\n' < "$selection") elif [ -n "$1" ]; then arr="$1" @@ -44,7 +44,7 @@ mocp_add() { done else - if [ -s "$selection" ]; then + if [ "$resp" = "y" ]; then xargs < "$selection" -0 mocp -a else mocp -a "$1" @@ -56,6 +56,11 @@ if [ ! -s "$selection" ] && [ -z "$1" ]; then exit fi +if [ -s "$selection" ]; then + echo -n "Work with selection? Enter 'y' to confirm: " + read resp +fi + if [ -z "$ret" ]; then # mocp not running mocp -S @@ -76,7 +81,7 @@ fi # clear selection and play mocp -c -mocp_add "$1" +mocp_add "$1" "$resp" mocp -p # uncomment the line below to show mocp interface after appending |