New backup 2024-04-10 16:30:04
This commit is contained in:
parent
32c7b642c5
commit
d796656c57
1 changed files with 11 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
profiles=( "Personal" "Development" "School" "Work" )
|
||||
icons=( "~" "" "" "" )
|
||||
|
||||
#echo ${profiles[@]/School//} | cut -d/ -f1 | wc -w | tr -d ' '
|
||||
profilem=$((${#profiles[@]}-1))
|
||||
|
||||
#echo ${#profiles[@]}
|
||||
|
@ -12,17 +13,20 @@ profilem=$((${#profiles[@]}-1))
|
|||
case $1 in
|
||||
next|prev)
|
||||
current_profile=$(cat "$(dirname $0)/data/active_profile")
|
||||
echo ${current_profile}
|
||||
;;&
|
||||
next)
|
||||
new_profile=$(( ${current_profile}+1 ))
|
||||
[[ "$new_profile" -eq "4" ]] && new_profile=0
|
||||
[[ "$new_profile" -eq "${#profiles[@]}" ]] && new_profile=0
|
||||
;;&
|
||||
prev)
|
||||
new_profile=$(( ${current_profile}-1 ))
|
||||
[[ "$new_profile" -eq "-1" ]] && new_profile=3
|
||||
;;&
|
||||
prev|next)
|
||||
op="${profiles[$new_profile]}"
|
||||
op=$(printf "%01d\n" ${new_profile})
|
||||
# echo
|
||||
# op="${profiles[$new_profile]}"
|
||||
;;
|
||||
*)
|
||||
for (( p="0"; p<=${profilem}; p++ ));do
|
||||
|
@ -30,10 +34,14 @@ case $1 in
|
|||
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}"
|
||||
op=$(echo ${profiles[@]/$op//} | cut -d/ -f1 | wc -w | tr -d ' ')
|
||||
;;
|
||||
esac
|
||||
|
||||
profile_number=""
|
||||
echo $op
|
||||
#printf "%01d\n" "$op"
|
||||
|
||||
exit
|
||||
|
||||
case $op in
|
||||
Personal)
|
||||
|
|
Loading…
Add table
Reference in a new issue