From f449ba5b023954104bc4c99b1c249d9709a9f527 Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 14 Aug 2022 14:01:59 +0200 Subject: [PATCH] bin/sway_move: include the current scale for the output --- bin/sway_move | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/sway_move b/bin/sway_move index 99099ea..b00aacc 100755 --- a/bin/sway_move +++ b/bin/sway_move @@ -43,9 +43,10 @@ initialise() { initialise "$@" dimensions=$( swaymsg -t get_outputs | jq -r '.. | select(.focused?) | .current_mode | "\(.width)x\(.height)"' ) +scale=$(swaymsg -t get_outputs | jq -r '.. | select(.focused?) | .scale' ) -monitor_width=${dimensions%x*} -monitor_height=${dimensions#*x} +monitor_width=$(echo "${dimensions%x*}/$scale / 1" | bc) +monitor_height=$(echo "${dimensions#*x}/$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' ) ) @@ -54,8 +55,6 @@ win_width=${win_dim[0]} win_height=${win_dim[1]} deco_height=${win_dim[2]} -#echo "$win_height $win_width $deco_height" - spacing_x=5 spacing_y=35 new_x=$spacing_x