This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.local/bin/screenshot

24 lines
712 B
Plaintext
Raw Normal View History

#!/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