dotfiles/.bin/sshot

27 lines
585 B
Plaintext
Raw Normal View History

2023-02-22 08:31:38 +01:00
#!/bin/sh -e
. ${HOME}/.bin/_config
trap cleanup 1 2 3 6
cleanup() {
rm -f "${_file_tmp}";
notify-send "sshot: Aborted..."
}
2023-04-14 16:46:09 +02:00
_filename="$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
2023-02-22 08:31:38 +01:00
_file_tmp="/tmp/${_filename}"
_file_out="${HOME}/.screenshots/${_filename}"
flameshot gui -p "${_file_tmp}"
test -f "${_file_tmp}" || exit 1
pngcrush -reduce "${_file_tmp}"
mv "${_file_tmp}" "${_file_out}"
scp "${_file_out}" "sdk@codevoid.de:/home/www/htdocs/gopher/p/${_filename}"
printf '%s' "https://codevoid.de/I/p/${_filename}" | xclip
2023-04-13 22:02:36 +02:00
notify-send "https://codevoid.de/I/p/${_filename}"