Commit a6f6ae1

Ansari <ping@ansari.wtf>
2025-07-19 17:37:32
screenshot script
1 parent eae0d67
Changed files (2)
.scripts/screenshot.sh
@@ -0,0 +1,42 @@
+#!/bin/zsh
+
+OPTIONS=(
+    "๐Ÿ“ธ Capture region"
+    "๐Ÿ“‹ Capture region (to clipboard)"
+    "๐ŸชŸ Capture active window"
+    "๐Ÿ–ฅ๏ธ Capture full screen"
+    "๐Ÿ“‚ Open screenshots folder"
+    "๐Ÿงน Clear screenshots folder"
+)
+
+# Show rofi menu and get selected option
+CHOICE=$(printf "%s\n" "${OPTIONS[@]}" | rofi -dmenu -i -p "Screenshot Menu" -theme $HOME/.scripts/scripts.rofi.rasi -theme-str 'listview {lines:6;}' 2>/dev/null)
+
+SCREENSHOT_DIR=$HOME/dev/desktop/screenshots
+mkdir -p "$SCREENSHOT_DIR"  # Ensure directory exists
+
+case "$CHOICE" in
+    "๐Ÿ“ธ Capture region")
+        hyprshot -m region -o "$SCREENSHOT_DIR" && \
+        notify-send "Screenshot Taken" "Region saved to $SCREENSHOT_DIR"
+        ;;
+    "๐Ÿ“‹ Capture region (to clipboard)")
+        hyprshot -m region --clipboard-only && \
+        notify-send "Screenshot Copied" "Region copied to clipboard"
+        ;;
+    "๐ŸชŸ Capture active window")
+        hyprshot -m window -m active -o "$SCREENSHOT_DIR" && \
+        notify-send "Screenshot Taken" "Window saved to $SCREENSHOT_DIR"
+        ;;
+    "๐Ÿ–ฅ๏ธ Capture full screen")
+        hyprshot -m output -o "$SCREENSHOT_DIR" && \
+        notify-send "Screenshot Taken" "Full screen saved to $SCREENSHOT_DIR"
+        ;;
+    "๐Ÿ“‚ Open screenshots folder")
+        xdg-open "$SCREENSHOT_DIR" &>/dev/null
+        ;;
+    "๐Ÿงน Clear screenshots folder")
+        rm -i "$SCREENSHOT_DIR"/* && \
+        notify-send "Screenshots Cleared" "All files deleted from $SCREENSHOT_DIR"
+        ;;
+esac
\ No newline at end of file
.scripts/scripts.rofi.rasi
@@ -0,0 +1,21 @@
+@import "custom-rasi-theme.rasi"
+
+mainbox {
+    padding:    0px;
+    margin: 0px;
+}
+
+inputbar {
+    enabled:false;
+    padding:0px;
+}
+
+listview {
+    margin:0px;
+    lines:5;
+}
+
+element {
+    padding:        10px 0px;
+    spacing:        0px;
+}