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