Created
March 20, 2025 21:11
-
-
Save duckythescientist/898e88fbb09f754d90f62bf0c6ef228d to your computer and use it in GitHub Desktop.
Better screenshots - because xfce4-screenshooter only gives me black screens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Better screenshots - because xfce4-screenshooter only gives me black screens | |
# /home/duck/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml | |
# <property name="<Primary><Shift>Print" type="string" value="/home/duck/.local/bin/scrotshot.sh regionclip"/> | |
# <property name="<Shift>Print" type="string" value="/home/duck/.local/bin/scrotshot.sh region"/> | |
# <property name="Print" type="string" value="/home/duck/.local/bin/scrotshot.sh full"/> | |
# <property name="<Primary>Print" type="string" value="/home/duck/.local/bin/scrotshot.sh fullclip"/> | |
# <property name="<Primary><Super>Print" type="string" value="/home/duck/.local/bin/scrotshot.sh activeclip"/> | |
# <property name="<Super>Print" type="string" value="/home/duck/.local/bin/scrotshot.sh active"/> | |
filename="${HOME}/Pictures/screenshot_%Y-%m-%d_%s.png" | |
tmpfile="/tmp/scrot_tmp.png" | |
selection="-s -l mode=edge" | |
case $1 in | |
region) | |
scrot $selection -F "$filename" | |
;; | |
full) | |
scrot -F "$filename" | |
;; | |
regionclip) | |
scrot $selection -F "$tmpfile" | |
xclip -selection clipboard -t image/png -i "$tmpfile" | |
rm "$tmpfile" | |
;; | |
fullclip) | |
scrot -F "$tmpfile" | |
xclip -selection clipboard -t image/png -i "$tmpfile" | |
rm "$tmpfile" | |
;; | |
active) | |
scrot -u -F "$filename" | |
;; | |
activeclip) | |
scrot -u -F "$tmpfile" | |
xclip -selection clipboard -t image/png -i "$tmpfile" | |
rm "$tmpfile" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment