diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/menuscripts/mpass | 2 | ||||
-rwxr-xr-x | bin/menuscripts/mpdf | 11 | ||||
-rwxr-xr-x | bin/menuscripts/mvid | 9 |
3 files changed, 10 insertions, 12 deletions
diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 01c40e3..87559e9 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -1,5 +1,5 @@ #!/usr/bin/env sh -store="$HOME/.password-store" +store="${PASSWORD_STORE_DIR:-$HOME/.password-store}" lscmd="ls --group-directories-first" if [ "$MENUCMD" = "tofi" ] then diff --git a/bin/menuscripts/mpdf b/bin/menuscripts/mpdf index d26c841..d67fdae 100755 --- a/bin/menuscripts/mpdf +++ b/bin/menuscripts/mpdf @@ -12,14 +12,11 @@ fi tmp="/tmp/dmpdf" find ${1:-$HOME/docs $HOME/dl} 2> /dev/null | grep -E ".+\.pdf" | sort > "$tmp" -choice="$(\ - sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' "$tmp" | +choice="$(sed "s|^$HOME|\~| ; s|\([^/]\)[^/]*/|\1/|g" "$tmp" | awk '{printf "%s %s\n", NR ":", $0}' | $menucmd | - grep -oE "^[0-9]+:" | - cut -f1 -d:)" -if [ -z "$choice" ]; then - exit -fi + grep -o "^[0-9]\+:" | + cut -f 1 -d :)" +test -z "$choice" && exit 1 file="$(sed -n "${choice}p" "$tmp")" zathura "$file" & diff --git a/bin/menuscripts/mvid b/bin/menuscripts/mvid index 8d14c4b..ca309fb 100755 --- a/bin/menuscripts/mvid +++ b/bin/menuscripts/mvid @@ -1,10 +1,11 @@ #!/usr/bin/env sh +tmpfile="/tmp/dmvids" + dirs="${1:-$HOME/vids $HOME/dl}" find -L $dirs 2> /dev/null | grep ".\+\.\(webm\|mp4\|mpeg\|mkv\)$" | - sort > /tmp/dmvids -cat /tmp/dmvids + sort > "$tmpfile" if [ "$MENUCMD" = "tofi" ] then @@ -16,11 +17,11 @@ else menucmd="fzf" fi -choice="$(sed 's|^/home/aluc|\~| ; s|\([^/]\)[^/]*/|\1/|g' /tmp/dmvids | +choice="$(sed "s|^$HOME|\~| ; s|\([^/]\)[^/]*/|\1/|g" "$tmpfile" | awk '{printf "%s %s\n", NR ":", $0}' | $menucmd | cut -f 1 -d ':')" test -z "$choice" && exit 1 -mpv "$(sed -n "${choice}p" /tmp/dmvids)" +mpv "$(sed -n "${choice}p" "$tmpfile")" |