From d7c55140f1785b8d9fef351f1cd2a4c9e1eaa466 Mon Sep 17 00:00:00 2001 From: LuckShiba Date: Sun, 1 Dec 2024 01:25:01 -0300 Subject: [PATCH] grimblast: fix window area selection on fullscreen workspaces --- CHANGELOG.md | 4 ++++ grimblast/grimblast | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eff359b..c01e5d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 2024-12-01 + +grimblast: fix window selection on fullscreen + ### 2024-11-04 grimblast: use layerrules instead of modifying animations diff --git a/grimblast/grimblast b/grimblast/grimblast index c12ace1..c1ad889 100755 --- a/grimblast/grimblast +++ b/grimblast/grimblast @@ -222,8 +222,9 @@ elif [ "$SUBJECT" = "area" ]; then # this removes the black border seen around screenshots hyprctl keyword layerrule "noanim,selection" >/dev/null + FULLSCREEN_WORKSPACES="$(hyprctl workspaces -j | jq -r 'map(select(.hasfullscreen) | .id)')" WORKSPACES="$(hyprctl monitors -j | jq -r '[(foreach .[] as $monitor (0; if $monitor.specialWorkspace.name == "" then $monitor.activeWorkspace else $monitor.specialWorkspace end)).id]')" - WINDOWS="$(hyprctl clients -j | jq -r --argjson workspaces "$WORKSPACES" 'map(select([.workspace.id] | inside($workspaces)))')" + WINDOWS="$(hyprctl clients -j | jq -r --argjson workspaces "$WORKSPACES" --argjson fullscreenWorkspaces "$FULLSCREEN_WORKSPACES" 'map((select(([.workspace.id] | inside($workspaces)) and ([.workspace.id] | inside($fullscreenWorkspaces) | not) or .fullscreen > 0)))')" # shellcheck disable=2086 # if we don't split, spaces mess up slurp GEOM=$(echo "$WINDOWS" | jq -r '.[] | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | slurp $SLURP_ARGS)