1#!/bin/zsh
2
3OPTIONS=(
4 "๐ธ Capture region"
5 "๐ Capture region (to clipboard)"
6 "๐ช Capture active window"
7 "๐ฅ๏ธ Capture full screen"
8 "๐ Open screenshots folder"
9 "๐งน Clear screenshots folder"
10)
11
12# Show rofi menu and get selected option
13CHOICE=$(printf "%s\n" "${OPTIONS[@]}" | rofi -dmenu -i -p "Screenshot Menu" -theme $HOME/.wraith/theme/scripts.rofi.rasi -theme-str 'listview {lines:6;}' 2>/dev/null)
14
15SCREENSHOT_DIR=$HOME/desktop/screenshots
16mkdir -p "$SCREENSHOT_DIR" # Ensure directory exists
17
18case "$CHOICE" in
19 "๐ธ Capture region")
20 hyprshot -m region -o "$SCREENSHOT_DIR" && \
21 notify-send "Screenshot Taken" "Region saved to $SCREENSHOT_DIR"
22 ;;
23 "๐ Capture region (to clipboard)")
24 hyprshot -m region --clipboard-only && \
25 notify-send "Screenshot Copied" "Region copied to clipboard"
26 ;;
27 "๐ช Capture active window")
28 hyprshot -m window -m active -o "$SCREENSHOT_DIR" && \
29 notify-send "Screenshot Taken" "Window saved to $SCREENSHOT_DIR"
30 ;;
31 "๐ฅ๏ธ Capture full screen")
32 hyprshot -m output -o "$SCREENSHOT_DIR" && \
33 notify-send "Screenshot Taken" "Full screen saved to $SCREENSHOT_DIR"
34 ;;
35 "๐ Open screenshots folder")
36 xdg-open "$SCREENSHOT_DIR" &>/dev/null
37 ;;
38 "๐งน Clear screenshots folder")
39 rm -i "$SCREENSHOT_DIR"/* && \
40 notify-send "Screenshots Cleared" "All files deleted from $SCREENSHOT_DIR"
41 ;;
42esac