Added option to select custom screenshot tool

This commit is contained in:
Dylan 2016-01-08 17:04:23 +11:00
parent 9e31b7bf93
commit 69747da81a
2 changed files with 9 additions and 3 deletions

View File

@ -33,7 +33,7 @@ These are the script's optional dependencies:
- Window manager detection: wmctrl - Window manager detection: wmctrl
- This is used as a fallback to parsing ```.xinitrc``` and ```$XDG_CURRENT_DESKTOP```. - This is used as a fallback to parsing ```.xinitrc``` and ```$XDG_CURRENT_DESKTOP```.
- Take a screenshot on script finish: scrot - Take a screenshot on script finish: scrot
- I'll add an option to specify a custom cmd soon. - You can change this to another program with a ```--scrotcmd``` and an in script option.
<!-- }}} --> <!-- }}} -->

10
fetch
View File

@ -212,6 +212,10 @@ xoffset=0
# --scrot on/off # --scrot on/off
scrot="off" scrot="off"
# Screenshot program to launch
# --scrotcmd
scrotcmd="scrot -c -d 3"
# Scrot dir # Scrot dir
# Where to save the screenshots # Where to save the screenshots
# --scrotdir /path/to/screenshot/folder # --scrotdir /path/to/screenshot/folder
@ -219,7 +223,7 @@ scrotdir="$HOME/Pictures"
# Scrot filename # Scrot filename
# What to name the screenshots # What to name the screenshots
# --scrot # --scrot str
scrotname="fetch-%Y-%m-%d-%H:%M.png" scrotname="fetch-%Y-%m-%d-%H:%M.png"
@ -763,7 +767,7 @@ getimage () {
} }
takescrot () { takescrot () {
scrot -c -d 3 "$scrotdir/$scrotname" $scrotcmd "$scrotdir/$scrotname"
} }
@ -874,6 +878,7 @@ usage () { cat << EOF
--scrot Take a screenshot --scrot Take a screenshot
--scrotdir Directory to save the scrot --scrotdir Directory to save the scrot
--scrotfile File name of scrot --scrotfile File name of scrot
--scrotcmd Screenshot program to launch
Other: Other:
--help Print this text and exit --help Print this text and exit
@ -947,6 +952,7 @@ while [ "$1" ]; do
--scrot|-s) scrot="on" ;; --scrot|-s) scrot="on" ;;
--scrotdir) scrot="$2" ;; --scrotdir) scrot="$2" ;;
--scrotfile) scrot="$2" ;; --scrotfile) scrot="$2" ;;
--scrotcmd) scrot="$2" ;;
# Other # Other
--help) usage ;; --help) usage ;;