update screenshot to be fancy
This commit is contained in:
@@ -9,7 +9,7 @@ source = ~/.config/hypr/monitors.conf
|
|||||||
$terminal = kitty
|
$terminal = kitty
|
||||||
$fileManager = dolphin
|
$fileManager = dolphin
|
||||||
$menu = rofi -show drun
|
$menu = rofi -show drun
|
||||||
$screenshot = grim -g "$(slurp)" - | swappy -f -
|
$screenshot = screenshot-upload
|
||||||
$calc = rofi -show calc -modi calc -no-show-match -no-sort
|
$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 = waybar & hyprpaper & firefox
|
||||||
exec-once = swww-daemon & disown
|
exec-once = swww-daemon & disown
|
||||||
|
|
||||||
|
exec-once = mako
|
||||||
|
|
||||||
# Don't want waybar on Berlin
|
# Don't want waybar on Berlin
|
||||||
exec-once = sh -c '[ "$(hostname)" != "berlin" ] && ~/.config/scripts/launch.sh'
|
exec-once = sh -c '[ "$(hostname)" != "berlin" ] && ~/.config/scripts/launch.sh'
|
||||||
|
|
||||||
|
|||||||
28
scripts/screenshot-upload.sh
Executable file
28
scripts/screenshot-upload.sh
Executable 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"
|
||||||
|
|
||||||
Reference in New Issue
Block a user