diff --git a/de/home/.config/sway/scripts/floating_toggle.sh b/de/home/.config/sway/scripts/floating_toggle.sh index 65a7300..471e362 100755 --- a/de/home/.config/sway/scripts/floating_toggle.sh +++ b/de/home/.config/sway/scripts/floating_toggle.sh @@ -6,11 +6,14 @@ if [[ "${active_window_type}" == "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})" - echo ${active_screen_width} - echo ${active_screen_height} if [[ "${active_screen_width}" -gt "${active_screen_height}" ]];then - swaymsg resize set 50ppt 50ppt + #landscape + win_height=$(( active_screen_height * 60 / 100 )) + win_width=$(( win_height * 175 / 100 )) else - swaymsg resize set 75ppt 25ppt + #portrait + win_width=$(( active_screen_width * 60 / 100 )) + win_height=$(( win_width * 57 / 100 )) fi + swaymsg resize set "${win_width}px" "${win_height}px" fi