diff options
author | oberon2007 | 2016-03-10 12:48:37 +0100 |
---|---|---|
committer | oberon2007 | 2016-03-10 12:48:37 +0100 |
commit | 91a9f07330328d3ea5c53652e701415f1ff9bf56 (patch) | |
tree | 8f1d5b3a990eff53a8154a46de046b3028092f1c /i3-scrot | |
download | aur-91a9f07330328d3ea5c53652e701415f1ff9bf56.tar.gz |
initial commit
Diffstat (limited to 'i3-scrot')
-rwxr-xr-x | i3-scrot | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/i3-scrot b/i3-scrot new file mode 100755 index 000000000000..15229f630ef6 --- /dev/null +++ b/i3-scrot @@ -0,0 +1,70 @@ +#!/bin/sh +# /usr/bin/i3-scrot +# +# simple screenshot-script using scrot for manjaro-i3 by oberon@manjaro.org + +_conf=$HOME/.config/i3-scrot.conf + +if ! [ -f $_conf ]; then + echo "scrot_dir=$(xdg-user-dir PICTURES)" > $_conf +fi + +source $_conf + +if ! [ -d $scrot_dir ]; then + mkdir -p $scrot_dir +fi + +case "$1" in + --desk|-d|$NULL) + cd $scrot_dir + scrot && + sleep 1 && + notify-send "screenshot has been saved in $scrot_dir" + ;; + --window|-w) + cd $scrot_dir + scrot -u && + sleep 1 && + notify-send "screenshot has been saved in $scrot_dir" + ;; + --select|-s) + cd $scrot_dir + notify-send 'select an area for the screenshot' & + scrot -s && + sleep 1 && notify-send "screenshot has been saved in $scrot_dir" + ;; + --help|-h) + echo " +available options: +-d | --desk full screen +-w | --window active window +-s | --select selection +-h | --help display this information + +Default option is 'full screen'. + +The file destination can be set in ${_conf}. +Default is $scrot_dir +" + ;; + *) + echo " +== ! i3-scrot: missing or wrong argument ! == + +available options: +-d | --desk full screen +-w | --window active window +-s | --select selection +-h | --help display this information + +Default option is 'full screen'. + +The file destination can be set in ${_conf}. +Default is $scrot_dir +" + + exit 2 +esac + +exit 0 |