Update 2023-11-01 10:14 OpenBSD/amd64-x13
This commit is contained in:
52
.bin/sshot
52
.bin/sshot
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user