forked from MX-Linux/mxfb-goodies
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmxfb-quickshot
More file actions
executable file
·66 lines (59 loc) · 1.26 KB
/
Copy pathmxfb-quickshot
File metadata and controls
executable file
·66 lines (59 loc) · 1.26 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
##this app was developed by tenner and can be downloaded in its original at http://tenr.de/snippets/scripts/shot.sh
##it has been modified here for use with MX-Fluxbox and released October 2020 under GPLv3
DESTDIR="${HOME}/Pictures"
NAME="`date +%y%m%d_%M%S_`\$wx\$h"
SUF="png"
PRE=""
#### Options. Consult 'man scrot' for other options ####
#Automatically take a full-screen shot with high quality
#OPTION="-q 100"
# Interactively select a window (click anywhere) or draw a rectangle with the mouse for a high-quality shot.
OPTION="-s -q 100"
display_help() {
cat << EOF
Usage: `basename "$0"` [-r/r/-w/w/-b/b] [-png|png|-jpg|jpg]
EOF
}
take_shot() {
scrot ${OPTION} "${PRE}${NAME}.${SUF}" -e 'mv $f '$DESTDIR' && feh --geometry 800x600 --scale-down '$DESTDIR'/$f'
}
if [ $# -gt 2 ]
then
display_help
exit 1
elif [ $# -eq 0 ]
then
take_shot
exit 0
else
case "$1" in
-r|r|-R|-r|root|Root|-root|-Root)
OPTION=""
;;
-w|w|-W|-W|window|Window|-window|-Window)
OPTION="-s"
#PRE="part_"
;;
-b|b|-B|-B|border|Border)
OPTION="-sb"
#PRE="part_"
;;
*)
display_help
exit 1
esac
case "$2" in
jpg|JPG|-jpg|-JPG)
SUF="jpg"
;;
png|PNG|-png|-PNG)
SUF="png"
;;
*)
display_help
exit 1
esac
take_shot
exit 0
fi