Skip to content

Instantly share code, notes, and snippets.

@vodolaz095
Created November 18, 2018 08:02
Show Gist options
  • Save vodolaz095/bf25654a50d7daf40fe1e831a81792bd to your computer and use it in GitHub Desktop.
Save vodolaz095/bf25654a50d7daf40fe1e831a81792bd to your computer and use it in GitHub Desktop.
screenshot - shell script to make and upload screenshot
#!/bin/bash
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 9 | head -n 1)
PIC_URL=$HOME/Pictures/Screenshots/$NEW_UUID.png
mkdir -p $HOME/Pictures/Screenshots
scrot -s -c $PIC_URL
scp $PIC_URL holod.local:/srv/www/s/
echo "View image on https://vodolaz095.life/s/$NEW_UUID.png"
echo "https://vodolaz095.life/s/$NEW_UUID.png" | xclip -selection clipboard
notify-send "View image on https://vodolaz095.life/s/$NEW_UUID.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment