move from swappy to satty

This commit is contained in:
Your Name
2026-08-14 12:41:06 +00:00
parent 4e40d20092
commit bac0151865
4 changed files with 19 additions and 40 deletions
+1 -1
View File
@@ -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
)
+6 -13
View File
@@ -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
+6 -13
View File
@@ -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
+6 -13
View File
@@ -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