diff options
| author | Justine Smithies <justine@smithies.me.uk> | 2026-05-28 20:38:11 +0100 |
|---|---|---|
| committer | Justine Smithies <justine@smithies.me.uk> | 2026-05-28 20:38:11 +0100 |
| commit | 458f0d8fa1ea02562f9e003fed9f6b107ec7d5b9 (patch) | |
| tree | 02429b9c5eb4c825cff6d9a410a4a3095c82822f /.local | |
| parent | be2c053fba0cfbcffa2c94b2da4c10ebf6cf3b3f (diff) | |
Fixed screenshot focused-window function.
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/screenshot.sh | 12 |
1 files changed, 4 insertions, 8 deletions
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 ;; *) |
