updates to swappy in screenshots
This commit is contained in:
@@ -22,9 +22,17 @@ fi
|
|||||||
|
|
||||||
# Open the editor if swappy is available (blocks until it is closed).
|
# 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
|
# swappy never overwrites the opened file on Ctrl+s (it saves a new
|
||||||
# timestamped copy to save_dir), so -o writes the final surface back here.
|
# 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
|
if command -v swappy >/dev/null 2>&1; then
|
||||||
swappy -f "$dir/$file" -o "$dir/$file"
|
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"
|
||||||
wl-copy -t image/png < "$dir/$file"
|
wl-copy -t image/png < "$dir/$file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,17 @@ fi
|
|||||||
|
|
||||||
# Open the editor if swappy is available (blocks until it is closed).
|
# 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
|
# swappy never overwrites the opened file on Ctrl+s (it saves a new
|
||||||
# timestamped copy to save_dir), so -o writes the final surface back here.
|
# 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
|
if command -v swappy >/dev/null 2>&1; then
|
||||||
swappy -f "$dir/$file" -o "$dir/$file"
|
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"
|
||||||
wl-copy -t image/png < "$dir/$file"
|
wl-copy -t image/png < "$dir/$file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -42,9 +42,17 @@ fi
|
|||||||
|
|
||||||
# Open the editor if swappy is available (blocks until it is closed).
|
# 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
|
# swappy never overwrites the opened file on Ctrl+s (it saves a new
|
||||||
# timestamped copy to save_dir), so -o writes the final surface back here.
|
# 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
|
if command -v swappy >/dev/null 2>&1; then
|
||||||
swappy -f "$dir/$file" -o "$dir/$file"
|
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"
|
||||||
wl-copy -t image/png < "$dir/$file"
|
wl-copy -t image/png < "$dir/$file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user