aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/screenshot.sh12
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
;;
*)