blob: a205bf43ccc55e0ab369bc7f6e4b4b713c5613a6 (
plain)
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
|
#!/bin/sh
dir="$(xdg-user-dir PICTURES)"
dir="${dir:-$HOME/pics}/screenshots"
mkdir -p "$dir"
case $1 in
"-m")
actwin="$(hyprctl activewindow -j | jq -r '.monitor')"
actmon="$(hyprctl monitors -j |
jq -r ".[] | select(.id == $actwin)" |
jq -r '.name')"
grim -o "$actmon" "$dir/$(date +%y%m%d_%H_%M_%S)_mon.png"
;;
"-f")
grim "$dir/$(date +%y%m%d_%H_%M_%S)_full.png"
;;
"-s")
grim -g "$(slurp)" "$dir/$(date +%y%m%d_%H_%M_%S)_sel.png"
;;
"-sc")
grim -g "$(slurp)" - | wl-copy
;;
*)
exit
;;
esac
|