Skip to content

Commit

Permalink
Add ss-open
Browse files Browse the repository at this point in the history
  • Loading branch information
lainiwa committed May 25, 2024
1 parent a8c633f commit a6e0242
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions laintools
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,18 @@ copy_to_clipboard() {
fi
}

open_last_screenshot() {
for file in ~/0files/imgs/screenshots/*.png; do :; done
if has nsxiv; then
nsxiv "${file}"
elif has sxiv; then
sxiv "${file}"
else
printf '%s\n' "Not found sxiv/nsxiv"
exit 1
fi
}

# https://wiki.archlinux.org/title/List_of_applications/Multimedia#Console
optimize_image() {
if has oxipng; then
Expand Down Expand Up @@ -301,6 +313,10 @@ main() {
exit 0
fi

elif [ "${1:-}" = "ss-open" ]; then
open_last_screenshot
exit 0

elif [ "${1:-}" = "drbtt" ]; then
drbttd
exit 0
Expand Down

0 comments on commit a6e0242

Please sign in to comment.