dotfiles/.bin/sshot
2026-01-17 09:55:19 +01:00

29 lines
472 B
Bash
Executable File

#!/bin/sh
. ${HOME}/.bin/_config
unset QT_FONT_DPI
unset GDK_DPI_SCALE
trap cleanup 1 2 3 6
cleanup() { rm -f "$file"; }
# 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)"