Skip to content

Commit a6e0242

Browse files
committed
Add ss-open
1 parent a8c633f commit a6e0242

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

laintools

+16
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,18 @@ copy_to_clipboard() {
231231
fi
232232
}
233233

234+
open_last_screenshot() {
235+
for file in ~/0files/imgs/screenshots/*.png; do :; done
236+
if has nsxiv; then
237+
nsxiv "${file}"
238+
elif has sxiv; then
239+
sxiv "${file}"
240+
else
241+
printf '%s\n' "Not found sxiv/nsxiv"
242+
exit 1
243+
fi
244+
}
245+
234246
# https://wiki.archlinux.org/title/List_of_applications/Multimedia#Console
235247
optimize_image() {
236248
if has oxipng; then
@@ -301,6 +313,10 @@ main() {
301313
exit 0
302314
fi
303315

316+
elif [ "${1:-}" = "ss-open" ]; then
317+
open_last_screenshot
318+
exit 0
319+
304320
elif [ "${1:-}" = "drbtt" ]; then
305321
drbttd
306322
exit 0

0 commit comments

Comments
 (0)