22 lines
465 B
Bash
Executable file
22 lines
465 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# The rofi prompt
|
|
PROMPT="Screenshot"
|
|
|
|
# Actions for the menu
|
|
ACTIONS=(
|
|
"1: Fullscreen"
|
|
"2: Selection"
|
|
)
|
|
|
|
FILENAME="$(xdg-user-dir PICTURES)/screenshots/$(date +"%Y-%m-%dT%H%M%S").png"
|
|
|
|
SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | fuzzel -dmenu -I| cut -d ":" -f1)
|
|
case "${SELECTION}" in
|
|
"1")
|
|
grim - | tee "${FILENAME}" | wl-copy
|
|
;;
|
|
"2")
|
|
grim -g "$(slurp)" - | tee "${FILENAME}" | wl-copy
|
|
;;
|
|
esac
|