New backup 2024-04-11 10:45:02

This commit is contained in:
Penelope Gwen 2024-04-11 10:45:02 -06:00
parent 92a9b0dc62
commit b1ff8d7ba0
3 changed files with 75 additions and 20 deletions

View file

@ -11,28 +11,31 @@ bindsym $mod+Backslash exec "$HOME/.config/sway/scripts/profiles.sh Work"
#set $pn "1"
# Switch to
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# bindsym $mod+1 workspace number 1
# bindsym $mod+2 workspace number 2
# bindsym $mod+3 workspace number 3
# bindsym $mod+4 workspace number 4
# bindsym $mod+5 workspace number 5
# bindsym $mod+6 workspace number 6
# bindsym $mod+7 workspace number 7
# bindsym $mod+8 workspace number 8
# bindsym $mod+9 workspace number 9
# bindsym $mod+0 workspace number 10
# Move to
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# bindsym $mod+Shift+1 move container to workspace number 1
# bindsym $mod+Shift+2 move container to workspace number 2
# bindsym $mod+Shift+3 move container to workspace number 3
# bindsym $mod+Shift+4 move container to workspace number 4
# bindsym $mod+Shift+5 move container to workspace number 5
# bindsym $mod+Shift+6 move container to workspace number 6
# bindsym $mod+Shift+7 move container to workspace number 7
# bindsym $mod+Shift+8 move container to workspace number 8
# bindsym $mod+Shift+9 move container to workspace number 9
# bindsym $mod+Shift+0 move container to workspace number 10
exec "$HOME/.config/sway/scripts/profiles.sh Personal"
rename workspace "1" to "1:~"
#
# Trackpad

View file

@ -43,6 +43,7 @@ p_icon="${icons[$op]}"
for i in {1..10};do
[[ "$i" -eq "10" ]] && k="0" || k=$i
swaymsg 'bindsym $mod+'"$k"' workspace number "'"${p_num}${i}:${p_icon}"'"'
swaymsg 'bindsym $mod+Shift+'"$k"' move container to workspace number "'"${p_num}${i}:${p_icon}"'"'
done
moveto="${p_num}1:${p_icon}"

View file

@ -0,0 +1,51 @@
#!/usr/bin/env bash
profiles=( "Personal" "Development" "School" "Work")
icons=( "~" "" "" "" "a" )
#echo ${profiles[@]/School//} | cut -d/ -f1 | wc -w | tr -d ' '
profilem=$((${#profiles[@]}-1))
#echo ${#profiles[@]}
#exit
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 "${#profiles[@]}" ]] && new_profile=0
;;&
prev)
new_profile=$(( ${current_profile}-1 ))
[[ "$new_profile" -eq "-1" ]] && new_profile=3
;;&
prev|next)
op=$(printf "%01d\n" ${new_profile})
;;
*)
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 -k /dev/null | awk '{print $2}' ) || op="${1}"
op=$(echo ${profiles[@]/$op//} | cut -d/ -f1 | wc -w | tr -d ' ')
;;
esac
[[ "$op" -gt "$profilem" ]] && exit
[[ $op -eq "0" ]] && p_num="" || p_num="$op"
p_icon="${icons[$op]}"
for i in {1..10};do
[[ "$i" -eq "10" ]] && k="0" || k=$i
swaymsg 'bindsym $mod+'"$k"' workspace number "'"${p_num}${i}:${p_icon}"'"'
swaymsg 'bindsym $mod+Shift'"$k"' move container to workspace number "'"${p_num}${i}:${p_icon}"'"'
done
moveto="${p_num}1:${p_icon}"
swaymsg 'workspace number "'"${p_num}"'"1:"'"${p_icon}"'"'
echo "${op}" > "$(dirname $0)/data/active_profile"