Skip to content

Instantly share code, notes, and snippets.

@MatthieuLeboeuf
Last active May 17, 2023 17:40
Show Gist options
  • Save MatthieuLeboeuf/dc058da19785b951e4df327decda3318 to your computer and use it in GitHub Desktop.
Save MatthieuLeboeuf/dc058da19785b951e4df327decda3318 to your computer and use it in GitHub Desktop.
#!/bin/sh
UUID=$(cat /proc/sys/kernel/random/uuid)
touch /tmp/$UUID
tmp="/tmp/$UUID"
#gnome-screenshot -a -f $tmp
spectacle -rbn -o $tmp
size=$(wc -c < "$tmp")
if [ $size != 0 ]; then
rclone copy --header-upload "Content-Type: image/png" $tmp sharex:sharex
echo "https://s.matthieul.dev/$UUID" | xclip -sel c
notify-send "screenshot sent" -t 2000
exit 0
fi
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment