From 32c7b642c5ffc3477c202e79f1f6c9e526b098a3 Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Wed, 10 Apr 2024 16:15:03 -0600 Subject: [PATCH] New backup 2024-04-10 16:15:03 --- de/home/.config/sway/scripts/profiles.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/de/home/.config/sway/scripts/profiles.sh b/de/home/.config/sway/scripts/profiles.sh index 2cb26dc..570c140 100755 --- a/de/home/.config/sway/scripts/profiles.sh +++ b/de/home/.config/sway/scripts/profiles.sh @@ -3,13 +3,11 @@ profiles=( "Personal" "Development" "School" "Work" ) icons=( "~" "" "" "" ) -echo ${#profiles[@]} +profilem=$((${#profiles[@]}-1)) -exit +#echo ${#profiles[@]} -for p in ${profiles[@]};do - echo "${p}" -done +#exit case $1 in next|prev) @@ -27,7 +25,11 @@ case $1 in op="${profiles[$new_profile]}" ;; *) - [[ -z $1 ]] && op=$( echo -e "~ Personal\n Development\n School\n Work" | wofi -i --dmenu --width 250 --height 320 | awk '{print $2}' ) || op="${1}" + for (( p="0"; p<=${profilem}; p++ ));do + [[ $p -eq $profilem ]] && nl="" || nl="\n" + wofilist="${wofilist}${icons[$p]} ${profiles[$p]}${nl}" + done + [[ -z $1 ]] && op=$( echo -e "${wofilist}" | wofi -i --dmenu --width 250 --height 320 | awk '{print $2}' ) || op="${1}" ;; esac