24 lines
712 B
Bash
Executable File
24 lines
712 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
######################################################################
|
|
# @author : swytch
|
|
# @file : screenshot
|
|
# @license : GPLv3
|
|
# @created : Wednesday May 20, 2020 17:52:58 CEST
|
|
#
|
|
# @description : grab a screenshot
|
|
# @deps : scrot xclip dunstify
|
|
######################################################################
|
|
|
|
|
|
sleep .1
|
|
if [ "-w" = "$1" ]; then
|
|
scrot -e 'xclip -selection clipboard -t image/png -i $f && rm $f'
|
|
else
|
|
if [ ! "" = "$1" ]; then
|
|
dunstify -u "normal" " Wrong parameter. No screenshot taken" && exit 1
|
|
else
|
|
scrot -s -e 'xclip -selection clipboard -t image/png -i $f && rm $f'
|
|
fi
|
|
fi
|