sway_move: fix on transformed output

This commit is contained in:
Konstantin Koslowski 2023-09-10 14:36:27 +02:00 committed by Konstantin Koslowski
parent a55965ddcd
commit 766a844a51

View file

@ -41,13 +41,13 @@ initialise() {
}
initialise "$@"
dimensions=$( swaymsg -t get_outputs |
jq -r '.. | select(.focused?) | .current_mode | "\(.width)x\(.height)"' )
width=$( swaymsg -t get_outputs |
jq -r '.. | select(.focused?) | .rect | .width' )
height=$( swaymsg -t get_outputs |
jq -r '.. | select(.focused?) | .rect | .height' )
scale=$(swaymsg -t get_outputs | jq -r '.. | select(.focused?) | .scale' )
monitor_width=$(echo "${dimensions%x*}/$scale / 1" | bc)
monitor_height=$(echo "${dimensions#*x}/$scale / 1" | bc)
monitor_width=$(echo "${width}/$scale / 1" | bc)
monitor_height=$(echo "${height}/$scale / 1" | bc)
win_dim=( $( swaymsg -t get_tree |
jq '.. | select(.type?) | select(.type=="floating_con") | select(.focused?)|.rect.width, .rect.height, .deco_rect.height' ) )