dotfiles/system/.local/bin/screenshot
Severin Kaderli 61012463fe
Clean up scripts
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2022-05-11 20:59:42 +02:00

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