main
59c7d64 ยท 8 days ago 139 commits
 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