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' ) )