From 03a85c3b2957d0cde8580fbb133ee6c41f6eacb2 Mon Sep 17 00:00:00 2001 From: caiowakamatsu Date: Thu, 8 Jan 2026 03:47:02 -0300 Subject: [PATCH] update screenshot to be fancy --- hypr/hyprland.conf | 4 +++- scripts/screenshot-upload.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 scripts/screenshot-upload.sh diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index e22e6ca..5874912 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -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' diff --git a/scripts/screenshot-upload.sh b/scripts/screenshot-upload.sh new file mode 100755 index 0000000..e4e3e5c --- /dev/null +++ b/scripts/screenshot-upload.sh @@ -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" +