From 766a844a5172ca0a2e568be6ab7586a3c83c00bd Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Sun, 10 Sep 2023 14:36:27 +0200 Subject: [PATCH] sway_move: fix on transformed output --- bin/sway_move | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/sway_move b/bin/sway_move index b00aacc..472d733 100755 --- a/bin/sway_move +++ b/bin/sway_move @@ -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' ) )