update screenshot to be fancy

This commit is contained in:
2026-01-08 03:47:02 -03:00
parent 28643cd8a8
commit 03a85c3b29
2 changed files with 31 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ source = ~/.config/hypr/monitors.conf
$terminal = kitty
$fileManager = dolphin
$menu = rofi -show drun
$screenshot = grim -g "$(slurp)" - | swappy -f -
$screenshot = screenshot-upload
$calc = rofi -show calc -modi calc -no-show-match -no-sort
#################
@@ -24,6 +24,8 @@ $calc = rofi -show calc -modi calc -no-show-match -no-sort
# exec-once = waybar & hyprpaper & firefox
exec-once = swww-daemon & disown
exec-once = mako
# Don't want waybar on Berlin
exec-once = sh -c '[ "$(hostname)" != "berlin" ] && ~/.config/scripts/launch.sh'

28
scripts/screenshot-upload.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
set -a
source ~/.config/imgshare.env
set +a
TOKEN="${IMGSHARE_TOKEN:?IMGSHARE_TOKEN not set}"
ENDPOINT="https://share.caio.wakamatsu.cc/upload"
tmp=$(mktemp --suffix=.png)
grim -g "$(slurp)" "$tmp"
swappy -f "$tmp" -o "$tmp"
resp=$(curl -s "$ENDPOINT" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@$tmp")
url=$(echo "$resp" | jq -r '.url // empty')
if [[ -n "$url" ]]; then
echo "https://share.caio.wakamatsu.cc$url" | wl-copy
notify-send "Uploaded Image"
fi
rm "$tmp"