dotfiles/.bin/sshot

26 lines
433 B
Plaintext
Raw Normal View History

#!/bin/sh
2023-02-22 08:31:38 +01:00
. ${HOME}/.bin/_config
trap cleanup 1 2 3 6
cleanup() { rm -f "$file"; }
2023-02-22 08:31:38 +01:00
# FILENAME
file="${HOME}/Downloads/Screenshots/$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
mkdir -p "$(dirname "$file")"
# TAKE SCREENSHOT
flameshot gui -p "$file"
test -f "$file" || exit 1
# COMPRESS
test -f /usr/local/bin/pngcrush \
&& pngcrush -reduce "$file"
# UPLOAD
_SWM_WS=-1 texec "upload \"$file\""
# NOTIFY
NOTIFY_CMD "$(xclip -o)"