configs/desktop/scripts/print-select.sh

14 lines
350 B
Bash
Raw Normal View History

2022-08-19 16:23:29 -03:00
#!/bin/bash
2023-10-09 17:55:47 -03:00
name="$HOME/pics/screenshots/screenshot-$(date -Iseconds | cut -d '+' -f1).png"
if [[ $XDG_SESSION_TYPE == "x11" ]]; then
maim -u -s $name
xclip -selection clipboard -t image/png $name
fi
2022-08-19 16:23:29 -03:00
2023-10-09 17:55:47 -03:00
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
grim -g "$(slurp)" $name
xclip -selection clipboard -t image/png $name
wl-copy < $name
fi
2022-08-19 16:23:29 -03:00