From 75275359f80bf778d099762d654f4ec3f473d4a8 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sat, 13 Jun 2026 11:55:14 +0100 Subject: Changes to MangoWM IPC mmsg --- .local/bin/screenshot.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to '.local/bin/screenshot.sh') diff --git a/.local/bin/screenshot.sh b/.local/bin/screenshot.sh index 8276f65..715e9d5 100755 --- a/.local/bin/screenshot.sh +++ b/.local/bin/screenshot.sh @@ -14,11 +14,8 @@ case $1 in ;; focused-window) # Take a screenshot of the focused window - xpos=$(mmsg -o "$output" -x | grep "x" | awk '{print$2}') - ypos=$(mmsg -o "$output" -x | grep "y" | awk '{print$2}') - xsize=$(mmsg -o "$output" -x | grep "width" | awk '{print$2}') - ysize=$(mmsg -o "$output" -x | grep "height" | awk '{print$2}') - grim -g "$xpos"",""$ypos $xsize""x""$ysize" -t jpeg ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg + geometry=$(mmsg get focusing-client | jq -r '"\(.x),\(.y) \(.width)x\(.height)"') + grim -g "$geometry" -t jpeg ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg ;; *) # Take a screenshot of the currently focused output and save it into screenshots -- cgit v1.3