-
Notifications
You must be signed in to change notification settings - Fork 28
/
screenshot.sh
executable file
·44 lines (35 loc) · 924 Bytes
/
screenshot.sh
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
#!/usr/bin/env bash
pic_dir=$HOME/Pictures/ScreenShot
# screenshot_dir=${pic_dir}/ScreenShots
screenshot_png=${pic_dir}/SCREENSHOT.png
# flameshot_dir=${pic_dir}/FlameShots
flameshot_dir=${pic_dir}
flameshot_png=${pic_dir}/SCREENSHOT_FLAME.png
mkdir -p $pic_dir
mkdir -p $flameshot_dir
after() {
xclip -selection clipboard -t image/png -i "$screenshot_png" && prompt
}
flameshot_before() {
if [[ -e $flameshot_png ]]; then
rm -vf "${flameshot_png}"
fi
}
do_scrot() {
scrot $1 $screenshot_png
}
flameshot_area() {
flameshot_before
# https://github.com/flameshot-org/flameshot/issues/2275#issuecomment-1015073816
# flameshot gui -p $flameshot_dir -c
flameshot gui
}
prompt() {
t=`date +%T`
notify-send "Saved as $screenshot_png [${t}]"
}
case $1 in
full ) do_scrot && after ;;
area ) do_scrot -s && after ;;
area_fs ) flameshot_area ;;
esac