From 512e3285dd790d3253b5c3ff4638522d9e7a55cf Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 14 Aug 2026 12:30:10 +0000 Subject: [PATCH] updated screenshot tools to add editor --- install.sh | 6 +++++- scripts/screenshot/screenshot_area.sh | 11 +++++++++++ scripts/screenshot/screenshot_monitor.sh | 11 +++++++++++ scripts/screenshot/screenshot_window.sh | 11 +++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 81e9160..d8a27fe 100755 --- a/install.sh +++ b/install.sh @@ -23,6 +23,9 @@ REQUIRED_PKGS=( jq inetutils tmux + grim + slurp + wl-clipboard ) OPTIONAL_PKGS=( @@ -38,7 +41,8 @@ OPTIONAL_PKGS=( imagemagick "Image tools" OFF playerctl "Media control" OFF wlopm "Monitor power" OFF - hyprshot "Screenshot tool" OFF + swappy "Screenshot editor" OFF + oxipng "PNG compressor" OFF matugen "Theme generator" OFF ) diff --git a/scripts/screenshot/screenshot_area.sh b/scripts/screenshot/screenshot_area.sh index 20bda04..3dcac38 100755 --- a/scripts/screenshot/screenshot_area.sh +++ b/scripts/screenshot/screenshot_area.sh @@ -19,3 +19,14 @@ wl-copy -t image/png < "$dir/$file" if command -v notify-send >/dev/null 2>&1; then notify-send -a Screenshot -i camera-photo "Screenshot saved" "$file" fi + +# Open the editor if swappy is available (blocks until it is closed) +if command -v swappy >/dev/null 2>&1; then + swappy -f "$dir/$file" + wl-copy -t image/png < "$dir/$file" +fi + +# Compress the resulting image in the background if oxipng is available +if command -v oxipng >/dev/null 2>&1; then + oxipng --strip safe -o 4 "$dir/$file" & +fi diff --git a/scripts/screenshot/screenshot_monitor.sh b/scripts/screenshot/screenshot_monitor.sh index 386f018..273863b 100755 --- a/scripts/screenshot/screenshot_monitor.sh +++ b/scripts/screenshot/screenshot_monitor.sh @@ -20,3 +20,14 @@ wl-copy -t image/png < "$dir/$file" if command -v notify-send >/dev/null 2>&1; then notify-send -a Screenshot -i camera-photo "Screenshot saved" "$file" fi + +# Open the editor if swappy is available (blocks until it is closed) +if command -v swappy >/dev/null 2>&1; then + swappy -f "$dir/$file" + wl-copy -t image/png < "$dir/$file" +fi + +# Compress the resulting image in the background if oxipng is available +if command -v oxipng >/dev/null 2>&1; then + oxipng --strip safe -o 4 "$dir/$file" & +fi diff --git a/scripts/screenshot/screenshot_window.sh b/scripts/screenshot/screenshot_window.sh index 40f6cbd..cb39ed5 100755 --- a/scripts/screenshot/screenshot_window.sh +++ b/scripts/screenshot/screenshot_window.sh @@ -39,3 +39,14 @@ wl-copy -t image/png < "$dir/$file" if command -v notify-send >/dev/null 2>&1; then notify-send -a Screenshot -i camera-photo "Screenshot saved" "$file" fi + +# Open the editor if swappy is available (blocks until it is closed) +if command -v swappy >/dev/null 2>&1; then + swappy -f "$dir/$file" + wl-copy -t image/png < "$dir/$file" +fi + +# Compress the resulting image in the background if oxipng is available +if command -v oxipng >/dev/null 2>&1; then + oxipng --strip safe -o 4 "$dir/$file" & +fi