Skip to content

Instantly share code, notes, and snippets.

@johntyree
Created January 3, 2014 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johntyree/8245054 to your computer and use it in GitHub Desktop.
Save johntyree/8245054 to your computer and use it in GitHub Desktop.
Screenshot with scrot for hotkeys
#!/bin/bash
#GistID: 8245054
# By default we take a full screen shot and name it the current time
# If -s is passed as first argument, we do window/selection mode
DATETIME=$(date +%F_%T.%N | rev | cut -c 8- | rev)
OUTPUTDIR="~/Pictures/Screenshots/"
# exec_string="mv \$f $OUTPUTDIR; notify-send -i '$PWD/\$m' '\$f' && rm \$m"
exec_string="mv \$f $OUTPUTDIR; rm \$m"
scrot "$@" -bt 30% "$DATETIME.png" -e "$exec_string" \
&& copy <<< $(abspath "${OUTPUTDIR}/${DATETIME}.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment