nix-configs/scripts/desktop/window-screenshot.sh

9 lines
401 B
Bash
Raw Normal View History

2022-09-02 20:28:50 +02:00
unset x y w h
eval $(xwininfo -id $(xdotool getactivewindow) |
sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \
-e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \
-e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \
-e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" )
2022-09-19 00:40:42 +02:00
echo -n "$x $y $w $h"
flameshot gui --region "${w}x${h}+${x}+${y}" -c -p ~/Pictures/screenshots/