#!/usr/bin/env bash
# 
# SCRIPT NAME:
# screenshot
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# Displays a screenshot menu using rofi.
#
# USAGE:
# ./screenshot

# The rofi prompt
PROMPT="Screenshot"

# Actions for the menu
ACTIONS=(
    "1: Fullscreen"
    "2: Fullscreen (Clipboard)"
    "3: Selection"
    "4: Selection (Clipboard)"
)

FILENAME="${HOME}/Pictures/Screenshots/%Y-%m-%d-%H%M%S.png"

SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -p "${PROMPT}" | cut -d ":" -f1)
case "${SELECTION}" in
    "1")
        escrotum "${FILENAME}"
        ;;
    "2")
        escrotum -C "${FILENAME}"
        ;;
    "3")
        escrotum -s "${FILENAME}"
        ;;
    "4")
        escrotum -C -s "${FILENAME}"
        ;;
esac
