Update 2023-08-03 08:23 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id
2023-08-03 08:23:24 +02:00
parent bf9b18702c
commit 3765115a34
3 changed files with 38 additions and 16 deletions

View File

@@ -1,30 +1,51 @@
#!/bin/sh -e
. ${HOME}/.bin/_config
#
# SIGNAL HANDLER
#
trap cleanup 1 2 3 6
cleanup() {
rm -f "${_file_tmp}";
notify-send "sshot: Aborted..."
}
#
# CONFIGURATION
#
_filename="$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
_file_tmp="/tmp/${_filename}"
_file_out="${HOME}/.screenshots/${_filename}"
_file_dir="${HOME}/Downloads/Screenshots"
mkdir -p "$_file_dir"
mkdir -p "${HOME}/.screenshots"
#
# TAKE SCREENSHOT
#
flameshot gui -p "${_file_dir}/${_filename}"
test -f "${_file_dir}/${_filename}" || exit 1
pngcrush -reduce "${_file_dir}/${_filename}"
flameshot gui -p "${_file_tmp}"
#
# UPLOAD
#
scp "${_file_dir}/${_filename}" sdk@home.codevoid.de:web/static/paste/
test -f "${_file_tmp}" || exit 1
#
# BUILD WEBSITE
#
ssh home.codevoid.de "cd web && make update && make"
pngcrush -reduce "${_file_tmp}"
#
# COPY TO CLIPBOARD
#
printf '%s' "https://home.codevoid.de/paste/${_filename}" | xclip
cp "${_file_tmp}" "${_file_out}"
mv "${_file_tmp}" "~/Downloads/"
#
# PRINT TO STDOUT
#
echo "https://home.codevoid.de/paste/${_filename}"
echo "${_file_dir}/${_filename}"
scp "${_file_out}" "sdk@codevoid.de:/home/www/htdocs/gopher/p/${_filename}"
printf '%s' "https://codevoid.de/I/p/${_filename}" | xclip
echo "$_file_out"
notify-send "https://codevoid.de/I/p/${_filename}"
#
# NOTIFY
#
notify-send "https://home.codevoid.de/paste/${_filename}"