dotfiles/de/home/.config/sway/scripts/scratchpad_cycle.sh
2025-07-14 12:15:07 -07:00

12 lines
533 B
Bash
Executable file

#!/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'
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