New backup 2025-07-14 12:45:06

This commit is contained in:
Penelope Gwen 2025-07-14 12:45:06 -07:00
parent 53e0300723
commit 2662ee8c0e
3 changed files with 16 additions and 7 deletions

View file

@ -25,7 +25,8 @@ bindsym {
#focus parent #focus parent
$mod+a focus parent $mod+a focus parent
#toggle floating #toggle floating
$mod+Shift+space floating toggle, resize set 50ppt 50ppt # $mod+Shift+space floating toggle
$mod+Shift+space exec '$HOME/.config/sway/scripts/floating_toggle.sh'
#swap between tiles and floats #swap between tiles and floats
$mod+space focus mode_toggle $mod+space focus mode_toggle
#enter resize mode #enter resize mode

View file

@ -0,0 +1,14 @@
#!/bin/bash
swaymsg floating toggle
active_window_scratchstate="$(swaymsg -t get_tree | jq -r '.. | select(.type?) | select(.focused==true).type')"
if [[ "${active_window_type}" == "floating_con" ]];then
active_screen_dim="$(swaymsg -t get_outputs | jq -r '.. | select(.type?) | select(.focused==true).rect')"
active_screen_width="$(jq '.width' <<<${active_screen_dim})"
active_screen_height="$(jq '.height' <<<${active_screen_dim})"
if [[ "${active_screen_width}" -gt "${active_screen_height}" ]];then
swaymsg resize set 50ppt 50ppt
else
swaymsg resize set 75ppt 25ppt
fi
fi

View file

@ -1,17 +1,11 @@
#!/bin/bash #!/bin/bash
swaymsg scratchpad show swaymsg scratchpad show
#active_window_type="$(swaymsg -t get_tree | jq -r '.. | select(.type?) | select(.focused==true).type')"
#if [[ "${active_window_type}" == "floating_con" ]];then
active_window_scratchstate="$(swaymsg -t get_tree | jq -r '.. | select(.type?) | select(.focused==true).scratchpad_state')" active_window_scratchstate="$(swaymsg -t get_tree | jq -r '.. | select(.type?) | select(.focused==true).scratchpad_state')"
if [[ "${active_window_scratchstate}" != "none" ]];then if [[ "${active_window_scratchstate}" != "none" ]];then
active_screen_dim="$(swaymsg -t get_outputs | jq -r '.. | select(.type?) | select(.focused==true).rect')" active_screen_dim="$(swaymsg -t get_outputs | jq -r '.. | select(.type?) | select(.focused==true).rect')"
active_screen_width="$(jq '.width' <<<${active_screen_dim})" active_screen_width="$(jq '.width' <<<${active_screen_dim})"
active_screen_height="$(jq '.height' <<<${active_screen_dim})" active_screen_height="$(jq '.height' <<<${active_screen_dim})"
echo "width: ${active_screen_width}"
echo "half width: $((${active_screen_width}/2))"
echo "height: ${active_screen_height}"
echo "half height: $((${active_screen_height}/2))"
if [[ "${active_screen_width}" -gt "${active_screen_height}" ]];then if [[ "${active_screen_width}" -gt "${active_screen_height}" ]];then
swaymsg resize set 50ppt 50ppt swaymsg resize set 50ppt 50ppt
else else