-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathscrotutl
More file actions
executable file
·27 lines (22 loc) · 801 Bytes
/
scrotutl
File metadata and controls
executable file
·27 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
# scrotutl - wrapper script of scrot
function print_help() {
echo "Usage: $0 <argument>"
echo "-f: Fullscreen"
echo "-s: Select an Area"
echo "-w: Select a Window"
}
function send_noti() {
notify-send 'scrotutl' 'Screenshot has been saved.'
}
mkdir -p ~/Pictures/Screenshots
if [ $# -eq 0 ]; then
sleep 0.2 && scrot 'scrot-%F_%H%M%S_$wx$h.png' -e 'mv $f ~/Pictures/Screenshots' && send_noti
else
case $1 in
"-f") sleep 0.2 && scrot 'scrot-%F_%H%M%S_$wx$h.png' -e 'mv $f ~/Pictures/Screenshots' && send_noti;;
"-s") sleep 0.2 && scrot -sz 'scrot-%F_%H%M%S_$wx$h.png' -e 'mv $f ~/Pictures/Screenshots' && send_noti;;
"-w") sleep 0.2 && scrot -u 'scrot-%F_%H%M%S_$wx$h.png' -e 'mv $f ~/Pictures/Screenshots' && send_noti;;
*) print_help;;
esac
fi