Update 2023-11-01 10:14 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id
2023-11-01 10:14:00 +01:00
parent 09f9fd0045
commit f02cbd8d82
6 changed files with 293 additions and 177 deletions

View File

@@ -1,51 +1,23 @@
#!/bin/sh -e
. ${HOME}/.bin/_config
#
# SIGNAL HANDLER
#
trap cleanup 1 2 3 6
cleanup() {
rm -f "${_file_tmp}";
notify-send "sshot: Aborted..."
}
cleanup() { rm -f "$file"; }
#
# CONFIGURATION
#
_filename="$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
_file_dir="${HOME}/Downloads/Screenshots"
mkdir -p "$_file_dir"
# FILENAME
file="${HOME}/Downloads/Screenshots/$(date "+%Y-%m-%d_%H-%M-%S")-sshot.png"
mkdir -p "$(dirname "$file")"
#
# TAKE SCREENSHOT
#
flameshot gui -p "${_file_dir}/${_filename}"
test -f "${_file_dir}/${_filename}" || exit 1
pngcrush -reduce "${_file_dir}/${_filename}"
flameshot gui -p "$file"
test -f "$file" || exit 1
# COMPRESS
test -f /usr/local/bin/pngcrush \
&& pngcrush -reduce "$file"
#
# UPLOAD
#
scp "${_file_dir}/${_filename}" sdk@home.codevoid.de:make-web/src/paste/
_SWM_WS=-1 texec "upload \"$file\""
#
# BUILD WEBSITE
#
ssh home.codevoid.de "cd make-web && make install"
#
# COPY TO CLIPBOARD
#
printf '%s' "https://home.codevoid.de/paste/${_filename}" | xclip
#
# PRINT TO STDOUT
#
echo "https://home.codevoid.de/paste/${_filename}"
echo "${_file_dir}/${_filename}"
#
# NOTIFY
#
notify-send "https://home.codevoid.de/paste/${_filename}"
notify-send "$(xclip -o)"