bin/sway_move: include the current scale for the output

This commit is contained in:
Konstantin Koslowski 2022-08-14 14:01:59 +02:00
parent c3d0af22cd
commit f449ba5b02

View file

@ -43,9 +43,10 @@ initialise() {
initialise "$@" initialise "$@"
dimensions=$( swaymsg -t get_outputs | dimensions=$( swaymsg -t get_outputs |
jq -r '.. | select(.focused?) | .current_mode | "\(.width)x\(.height)"' ) jq -r '.. | select(.focused?) | .current_mode | "\(.width)x\(.height)"' )
scale=$(swaymsg -t get_outputs | jq -r '.. | select(.focused?) | .scale' )
monitor_width=${dimensions%x*} monitor_width=$(echo "${dimensions%x*}/$scale / 1" | bc)
monitor_height=${dimensions#*x} monitor_height=$(echo "${dimensions#*x}/$scale / 1" | bc)
win_dim=( $( swaymsg -t get_tree | win_dim=( $( swaymsg -t get_tree |
jq '.. | select(.type?) | select(.type=="floating_con") | select(.focused?)|.rect.width, .rect.height, .deco_rect.height' ) ) jq '.. | select(.type?) | select(.type=="floating_con") | select(.focused?)|.rect.width, .rect.height, .deco_rect.height' ) )
@ -54,8 +55,6 @@ win_width=${win_dim[0]}
win_height=${win_dim[1]} win_height=${win_dim[1]}
deco_height=${win_dim[2]} deco_height=${win_dim[2]}
#echo "$win_height $win_width $deco_height"
spacing_x=5 spacing_x=5
spacing_y=35 spacing_y=35
new_x=$spacing_x new_x=$spacing_x