43 lines
783 B
Bash
Executable file
43 lines
783 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
op=$( echo -e "~ Personal\n Development\n School\n Work" | wofi -i --dmenu --width 250 --height 320 | awk '{print $2}' )
|
|
echo "$op"
|
|
|
|
profile_number=""
|
|
|
|
case $op in
|
|
Personal)
|
|
profile_number=""
|
|
;;
|
|
Development)
|
|
profile_number="1"
|
|
;;
|
|
School)
|
|
profile_number="2"
|
|
;;
|
|
Work)
|
|
profile_number="3"
|
|
;;
|
|
*)
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
for i in {1..10};do
|
|
[[ "$i" -eq "10" ]] && k="0" || k=$i
|
|
echo $k
|
|
swaymsg 'bindsym $mod+'"$k"' workspace number "'"${profile_number}${i}"'"'
|
|
done
|
|
|
|
exit
|
|
|
|
new_ws="$op"
|
|
int=0
|
|
|
|
while [[ "\"$new_ws\"" == $(swaymsg -t get_workspaces | jq '.[] | select(.name=="'$new_ws'")|.name') ]];do
|
|
int=$(($int+1))
|
|
new_ws="${op}${int}"
|
|
done
|
|
echo "new_ws: $new_ws"
|
|
swaymsg workspace "${new_ws}"
|
|
sway reload
|