diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2021-04-07 20:26:42 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2021-04-07 20:26:42 +0200 |
commit | 1c44c9c5c18f23fd9307b9bdbafbff1d54acf5f0 (patch) | |
tree | eea5bfba86a831768a9473684ba687cc33f5b236 | |
parent | da7beecdd98f24aa7e5edbebdb8276750c09be4f (diff) | |
download | scripts-1c44c9c5c18f23fd9307b9bdbafbff1d54acf5f0.tar.gz scripts-1c44c9c5c18f23fd9307b9bdbafbff1d54acf5f0.zip |
Screenshots are now only of secondary screen if it is connected.
-rwxr-xr-x | screenshot.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/screenshot.sh b/screenshot.sh index 8b28978..3f68a04 100755 --- a/screenshot.sh +++ b/screenshot.sh @@ -6,6 +6,13 @@ borderColor="0.412,0.431,1" name="$(date +"%y%m%d_%H%M%S")".png file="$HOME/images/screenshots/""$name" -[ "$1" = "" ] && maim -u -m 8 "$file" && notify-send -t 800 "Screenshot $name taken." +# If secondary screen is connected take a screenshot of only it +geometry="" +if xrandr | grep -q '^HDMI-1-1'; then + g="$(xrandr | grep '^HDMI-1-1' | cut -d' ' -f3)" + geometry="-g $g" +fi + +[ "$1" = "" ] && maim -u -m 8 $geometry "$file" && notify-send -t 800 "Screenshot $name taken." [ "$1" = "-a" ] && maim -u -s -b 2 -c "$borderColor" -m 8 "$file" && notify-send -t 800 "Screenshot $name taken." [ "$1" = "-c" ] && maim -u -s -b 2 -c "$borderColor" -m 8 | xclip -selection clipboard -t image/png && notify-send -t 800 "Screenshot copied to clipboard." |