From e003cbb11fa20f1f3c6b076ea69dafafb8e0c1c5 Mon Sep 17 00:00:00 2001 From: Lucas Vivohost Date: Mon, 14 Sep 2026 10:32:01 +0200 Subject: [PATCH] feat(screenshots): add interactive screenshot capture utility feat(screenshots): automate screenshot naming and storage - Detect active Texmaker project directory automatically - Fall back to manual directory selection when needed - Prompt user for screenshot filename - Prevent accidental filename collisions - Copy screenshot name to clipboard automatically - Capture screenshots using GNOME Screenshot area selection - Allow repeated captures until user confirms the result - Store screenshots directly in project documentation folders - Add script documentation and usage instructions ads --- .../screenshot_grab.sh | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) rename {quiethost => image editing}/screenshot_grab.sh (54%) diff --git a/quiethost/screenshot_grab.sh b/image editing/screenshot_grab.sh similarity index 54% rename from quiethost/screenshot_grab.sh rename to image editing/screenshot_grab.sh index afe7145..c8a76ce 100755 --- a/quiethost/screenshot_grab.sh +++ b/image editing/screenshot_grab.sh @@ -1,4 +1,52 @@ #!/bin/bash + +############################################################################### +# Script Name: screenshot_grab.sh +# +# Description: +# Interactive screenshot capture tool for GNOME desktops. +# +# The script automatically determines a destination directory from an +# open Texmaker project when possible. If no Texmaker project is detected, +# the user is prompted to choose a destination folder manually. +# +# Features: +# - Automatic Texmaker project path detection +# - Manual directory selection fallback +# - User-defined screenshot filenames +# - Duplicate filename detection +# - Automatic filename copy to clipboard +# - Area screenshot capture using gnome-screenshot +# - Screenshot preview/confirmation loop +# +# Requirements: +# - Bash +# - zenity +# - gnome-screenshot +# - xclip +# - Texmaker (optional) +# +# Usage: +# ./screenshot_grab.sh +# +# Workflow: +# 1. Detect current Texmaker project folder or ask for a directory. +# 2. Enter a screenshot filename. +# 3. Filename is copied to the clipboard automatically. +# 4. Select a screen area using gnome-screenshot. +# 5. Confirm the result. +# 6. Retake the screenshot until satisfied. +# +# Output: +# /.png +# +# Notes: +# - The line beginning with ### contains the default fallback directory. +# - Existing filenames are checked before capturing. +# - Cancelling any dialog exits the script. +# +############################################################################### + ###/data/DatenLucas/Dokumente/Studium/Master/3.Semester/Mechatronische Systeme/Lernunterlagen/ DEFAULT_DIR="$(cat ~/scripts/screenshot_grab.sh | grep "###" | grep -v grep | sed 's/###//g')" cont=1