From bac01518654b82a14caad6c2e087bbae68470c24 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 14 Aug 2026 12:41:06 +0000 Subject: [PATCH] move from swappy to satty --- install.sh | 2 +- scripts/screenshot/screenshot_area.sh | 19 ++++++------------- scripts/screenshot/screenshot_monitor.sh | 19 ++++++------------- scripts/screenshot/screenshot_window.sh | 19 ++++++------------- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/install.sh b/install.sh index d8a27fe..1ac88a7 100755 --- a/install.sh +++ b/install.sh @@ -41,7 +41,7 @@ OPTIONAL_PKGS=( imagemagick "Image tools" OFF playerctl "Media control" OFF wlopm "Monitor power" OFF - swappy "Screenshot editor" OFF + satty "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 648d113..d0a7ef4 100755 --- a/scripts/screenshot/screenshot_area.sh +++ b/scripts/screenshot/screenshot_area.sh @@ -20,19 +20,12 @@ 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). -# swappy never overwrites the opened file on Ctrl+s (it saves a new -# timestamped copy to save_dir), so pass it a temporary config pointing -# save_dir/save_filename_format at our exact file: Ctrl+s then saves and -# exits (early_exit). -o writes the final surface when quitting with Esc/q. -# Note: closing with Ctrl+w or the X button quits without saving (swappy). -if command -v swappy >/dev/null 2>&1; then - cfg=$(mktemp -d) - mkdir -p "$cfg/swappy" - printf '[Default]\nsave_dir=%s\nsave_filename_format=%s\nearly_exit=true\n' \ - "$dir" "$file" > "$cfg/swappy/config" - XDG_CONFIG_HOME="$cfg" swappy -f "$dir/$file" -o "$dir/$file" - rm -rf "$cfg" +# Open the editor if satty is available (blocks until it is closed). +# satty writes the annotated image to --output-filename on Ctrl+s (and on +# Esc/Enter here) and exits immediately. +if command -v satty >/dev/null 2>&1; then + satty --filename "$dir/$file" --output-filename "$dir/$file" \ + --copy-command wl-copy --actions-on-escape save-to-file --early-exit wl-copy -t image/png < "$dir/$file" fi diff --git a/scripts/screenshot/screenshot_monitor.sh b/scripts/screenshot/screenshot_monitor.sh index 3733912..cfb4a81 100755 --- a/scripts/screenshot/screenshot_monitor.sh +++ b/scripts/screenshot/screenshot_monitor.sh @@ -21,19 +21,12 @@ 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). -# swappy never overwrites the opened file on Ctrl+s (it saves a new -# timestamped copy to save_dir), so pass it a temporary config pointing -# save_dir/save_filename_format at our exact file: Ctrl+s then saves and -# exits (early_exit). -o writes the final surface when quitting with Esc/q. -# Note: closing with Ctrl+w or the X button quits without saving (swappy). -if command -v swappy >/dev/null 2>&1; then - cfg=$(mktemp -d) - mkdir -p "$cfg/swappy" - printf '[Default]\nsave_dir=%s\nsave_filename_format=%s\nearly_exit=true\n' \ - "$dir" "$file" > "$cfg/swappy/config" - XDG_CONFIG_HOME="$cfg" swappy -f "$dir/$file" -o "$dir/$file" - rm -rf "$cfg" +# Open the editor if satty is available (blocks until it is closed). +# satty writes the annotated image to --output-filename on Ctrl+s (and on +# Esc/Enter here) and exits immediately. +if command -v satty >/dev/null 2>&1; then + satty --filename "$dir/$file" --output-filename "$dir/$file" \ + --copy-command wl-copy --actions-on-escape save-to-file --early-exit wl-copy -t image/png < "$dir/$file" fi diff --git a/scripts/screenshot/screenshot_window.sh b/scripts/screenshot/screenshot_window.sh index 6cf25a3..16a7c5c 100755 --- a/scripts/screenshot/screenshot_window.sh +++ b/scripts/screenshot/screenshot_window.sh @@ -40,19 +40,12 @@ 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). -# swappy never overwrites the opened file on Ctrl+s (it saves a new -# timestamped copy to save_dir), so pass it a temporary config pointing -# save_dir/save_filename_format at our exact file: Ctrl+s then saves and -# exits (early_exit). -o writes the final surface when quitting with Esc/q. -# Note: closing with Ctrl+w or the X button quits without saving (swappy). -if command -v swappy >/dev/null 2>&1; then - cfg=$(mktemp -d) - mkdir -p "$cfg/swappy" - printf '[Default]\nsave_dir=%s\nsave_filename_format=%s\nearly_exit=true\n' \ - "$dir" "$file" > "$cfg/swappy/config" - XDG_CONFIG_HOME="$cfg" swappy -f "$dir/$file" -o "$dir/$file" - rm -rf "$cfg" +# Open the editor if satty is available (blocks until it is closed). +# satty writes the annotated image to --output-filename on Ctrl+s (and on +# Esc/Enter here) and exits immediately. +if command -v satty >/dev/null 2>&1; then + satty --filename "$dir/$file" --output-filename "$dir/$file" \ + --copy-command wl-copy --actions-on-escape save-to-file --early-exit wl-copy -t image/png < "$dir/$file" fi