From f431a55990f3564948eb8988eaf8e7a6bdcddcb7 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sat, 8 Apr 2023 03:32:36 +0530 Subject: .scripts: 4chgettofi - replacing dmenu for tofi & sxiv for imv --- .scripts/4chgettofi | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to '.scripts') diff --git a/.scripts/4chgettofi b/.scripts/4chgettofi index 70219bc..9e16e0c 100755 --- a/.scripts/4chgettofi +++ b/.scripts/4chgettofi @@ -1,21 +1,24 @@ #!/bin/bash -rootpixloc="$HOME/pix/Wallpaper/4chget" -option=$(echo -e "wg\nw" | dmenu -p "Is it wallpaper/general (wg) or anime wallpaper (w)?") -dir=$(echo "" | dmenu -p "Enter folder name") -threadopt=$(echo -e "Yes\nNo" | dmenu -p "Do you have the thread link in your clipboard?") +rootpapesdir="$HOME/pix/Wallpaper/4chget" +while [[ "$option" != "w" && "$option" != "wg" ]]; do + option=$(echo -e "wg\nw" | tofi --prompt-text "Is it wallpaper/general (wg) or anime wallpaper (w)?") +done -[ "$threadopt" == "Yes" ] && thread=$(xclip -o|xargs -I % echo %|cut -d\/ -f6) || thread=$(echo "" | dmenu -p "Enter thread no.: (#######)") && +[[ $option == "w" ]] && parentdir="$rootpapesdir/w" && nel="nel" || parentdir="$rootpapesdir/wg" -if [[ "$option" = w ]] ; then - mkdir -p "$rootpixloc"/w/"$dir" - nel="nel" - else - mkdir -p "$rootpixloc"/wg/"$dir" -fi +while [[ -d "$parentdir/$dir" ]]; do + dir=$(tofi --prompt-text "Enter folder name: " --require-match=false