diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-22 02:05:44 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-22 02:05:44 +0200 |
commit | 36d2972c60ec86b873fa496d1f5ea95cf748cf49 (patch) | |
tree | a6d6750fa17c2964cd241afa8e963cac6106b390 /bin/menuscripts | |
parent | 4914b43f642e2772a140a8f9b1f26b4e555ed88b (diff) | |
parent | 32256e087aaf7744348a5ba33e802d5c8d9d97dd (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/menuscripts')
-rwxr-xr-x | bin/menuscripts/keyadd | 2 | ||||
-rwxr-xr-x | bin/menuscripts/mpass | 2 | ||||
-rwxr-xr-x | bin/menuscripts/mpass-otp | 2 | ||||
-rwxr-xr-x | bin/menuscripts/tsh | 21 |
4 files changed, 10 insertions, 17 deletions
diff --git a/bin/menuscripts/keyadd b/bin/menuscripts/keyadd index 12519ec..4e7949f 100755 --- a/bin/menuscripts/keyadd +++ b/bin/menuscripts/keyadd @@ -2,7 +2,7 @@ log() { - notify-send -t 1000 "keyadd" "$1" + notify-send -t 1000 "keyadd" "$1" & >&2 printf '%s\n' "$1" } diff --git a/bin/menuscripts/mpass b/bin/menuscripts/mpass index 7348321..f513b16 100755 --- a/bin/menuscripts/mpass +++ b/bin/menuscripts/mpass @@ -14,7 +14,7 @@ list_pswds() while [ -d "$store/$file" ] do - choice="$(list_pswds "$store/$file" | dmenu -c -g 4 -l 4)" + choice="$(list_pswds "$store/$file" | commander -c)" [ "$choice" ] || exit 1 [ -z "$file" ] && file="$choice" || file="$file/$choice" done diff --git a/bin/menuscripts/mpass-otp b/bin/menuscripts/mpass-otp index 52d1341..2be6186 100755 --- a/bin/menuscripts/mpass-otp +++ b/bin/menuscripts/mpass-otp @@ -1,7 +1,7 @@ #!/bin/sh pass="$(find "$PASSWORD_STORE_DIR"/keys/otp -iname "*.gpg" | sed "/^\./d;s#^$PASSWORD_STORE_DIR/keys/otp/##;s/\.gpg$//" | - commander -c)" + dmenu -c)" [ "$pass" ] || exit 1 pass otp -c keys/otp/"$pass" notify-send -t 1000 "mpass" "copied $pass" diff --git a/bin/menuscripts/tsh b/bin/menuscripts/tsh index aac27ee..0c57ee0 100755 --- a/bin/menuscripts/tsh +++ b/bin/menuscripts/tsh @@ -5,8 +5,8 @@ PROG="$(basename "$0")" # copy command and deps variable deps="pup curl $MENUCMD" -LIBPFX=/home/aluc/.local/share/tsh -module='1337x.sh' # default module +MODULES_PATH=$HOME/.local/share/tsh +module='nyaa.sh' # default module # Files export tmp="/tmp/$PROG" @@ -83,7 +83,7 @@ cleanup () done } -list_modules () { find -L "$LIBPFX" -type f -printf "%f\n"; } +list_modules () { find -L "$MODULES_PATH" -type f -printf "%f\n"; } # get a query from user based on MENUCMD get_query () @@ -121,14 +121,6 @@ show_files() rm -f "$tmp"/.torrent } -# Select a type after having displayed them with 'show_types' -select_type() -{ - for type in $categories - do printf "%s\n" "$type" - done | fzf -} - trap "exit 1" INT trap "cleanup" EXIT @@ -179,7 +171,7 @@ then # Get results rm -f "$results" "$links" # shellcheck source=/usr/local/lib/$PROG/nyaa.sh disable=SC1091 - . "$LIBPFX/$module" + . "$MODULES_PATH/$module" [ -f "$results" ] || die "No results." # Save which module was used @@ -190,7 +182,7 @@ fi # acquire get_magnet function # shellcheck source=/usr/local/lib/$PROG/nyaa.sh disable=SC1091 -getfunctions=1 . "$LIBPFX/$module" +getfunctions=1 . "$MODULES_PATH/$module" # select result from "$results" for choice in $(select_result | xargs) @@ -205,7 +197,8 @@ do if [ "$noaskdownload" ] || confirm 'download?' then - [ "${category:-$(select_type)}" ] || exit 1 + [ "$category" ] || category="$(printf '%s' "$categories" | tr ' ' '\n' | fzf)" + [ "$category" ] || exit 2 transmission-remote debuc.com -a "$magnet" -w "/downloads/$category" elif confirm "copy?" then |