From ec76f8dec3a59cf1c98dcf8e2c51a27d0bf58cd6 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Sun, 4 Oct 2026 23:40:22 +0200 Subject: [PATCH] chore(hypr): drop screenshot_window.sh, replaced by shot.sh --- hypr/scripts/screenshot_window.sh | 49 ------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 hypr/scripts/screenshot_window.sh diff --git a/hypr/scripts/screenshot_window.sh b/hypr/scripts/screenshot_window.sh deleted file mode 100755 index 39297ec..0000000 --- a/hypr/scripts/screenshot_window.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -# Get active window info in JSON format -WINDOW_INFO=$(hyprctl activewindow -j) - -# Extract window class name (app name) -APP_NAME=$(echo "$WINDOW_INFO" | jq -r '.class') - -# If app name is empty, null, or invalid, default to "unknown" -if [ -z "$APP_NAME" ] || [ "$APP_NAME" = "null" ]; then - APP_NAME="unknown" -fi - -# Sanitize app name: convert to lowercase and replace characters that aren't letters, numbers, hyphens, or underscores with underscores -APP_NAME_SAFE=$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9_-]/_/g') - -# Extract geometry: "x,y wxh" -GEOMETRY=$(echo "$WINDOW_INFO" | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"') - -# Check if geometry is valid -if [ -z "$GEOMETRY" ] || [ "$GEOMETRY" = "null,null nullxnull" ]; then - notify-send -u normal "Screenshot Error" "No active window found to screenshot." - exit 1 -fi - -ACTION=$1 - -case "$ACTION" in - copy) - grim -g "$GEOMETRY" - | wl-copy - notify-send -u low "Screenshot" "Active window ($APP_NAME) copied to clipboard" - ;; - save) - SCREENSHOTS_DIR="$HOME/Pictures/Screenshots" - APP_DIR="$SCREENSHOTS_DIR/$APP_NAME_SAFE" - mkdir -p "$APP_DIR" - FILE_NAME="$(date +'%Y-%m-%d_%H-%M-%S').png" - FILE_PATH="$APP_DIR/$FILE_NAME" - - grim -g "$GEOMETRY" "$FILE_PATH" - notify-send -u low "Screenshot" "Saved active window to $APP_NAME_SAFE/$FILE_NAME" - ;; - *) - echo "Usage: $0 {copy|save}" - exit 1 - ;; -esac - -exit 0