From 458f0d8fa1ea02562f9e003fed9f6b107ec7d5b9 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Thu, 28 May 2026 20:38:11 +0100 Subject: Fixed screenshot focused-window function. --- .local/bin/screenshot.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to '.local/bin/screenshot.sh') diff --git a/.local/bin/screenshot.sh b/.local/bin/screenshot.sh index 9481323..8276f65 100755 --- a/.local/bin/screenshot.sh +++ b/.local/bin/screenshot.sh @@ -14,14 +14,10 @@ case $1 in ;; focused-window) # Take a screenshot of the focused window - xpos=$(mmsg -g -x -o "$output" | grep "x" | awk '{print$2}') - xpos=$((xpos-2)) - ypos=$(mmsg -g -x -o "$output" | grep "y" | awk '{print$2}') - ypos=$((ypos-2)) - xsize=$(mmsg -g -x -o "$output" | grep "width" | awk '{print$2}') - ysize=$(mmsg -g -x -o "$output" | grep "height" | awk '{print$2}') - xsize=$((xsize+4)) # Value added is 2 times the border width - ysize=$((ysize+4)) # Value added is 2 times the border width + 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 ;; *) -- cgit v1.3