diff --git a/de/home/.config/sway/scripts/scratchpad_cycle.sh b/de/home/.config/sway/scripts/scratchpad_cycle.sh index cd7619f..dd7a370 100755 --- a/de/home/.config/sway/scripts/scratchpad_cycle.sh +++ b/de/home/.config/sway/scripts/scratchpad_cycle.sh @@ -1,3 +1,12 @@ #!/bin/bash -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 + echo 'active window is floating' + 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} +fi +#swaymsg scratchpad show