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