From 53e03007239faf82c29637ffa6c1c882e6fccb93 Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Mon, 14 Jul 2025 12:30:06 -0700 Subject: [PATCH] New backup 2025-07-14 12:30:06 --- .../.config/sway/scripts/scratchpad_cycle.sh | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/de/home/.config/sway/scripts/scratchpad_cycle.sh b/de/home/.config/sway/scripts/scratchpad_cycle.sh index dd7a370..26ab00d 100755 --- a/de/home/.config/sway/scripts/scratchpad_cycle.sh +++ b/de/home/.config/sway/scripts/scratchpad_cycle.sh @@ -1,12 +1,20 @@ #!/bin/bash -active_window_type="$(swaymsg -t get_tree | jq -r '.. | select(.type?) | select(.focused==true).type')" -if [[ "${active_window_type}" == "floating_con" ]];then - echo 'active window is floating' +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')" +if [[ "${active_window_scratchstate}" != "none" ]];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})" - echo ${active_screen_width} - echo ${active_screen_height} + 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 + swaymsg resize set 50ppt 50ppt + else + swaymsg resize set 75ppt 25ppt + fi fi -#swaymsg scratchpad show