config/bin/screenie

19 lines
370 B
Bash
Executable File

#!/bin/bash
NAME="ss-$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c${1:-32};)"
maim -m 10 -s /tmp/$NAME.jpg -c 1,0.25,0.25,0.6 --hidecursor
if [ $? -ne 0 ]; then
exit
fi
if [ ! -e /tmp/$NAME.jpg ]; then
exit
fi
scp /tmp/$NAME.jpg ss:ss
if [ $? -eq 0 ]; then
echo -n 'https://ss.fuyu.moe/nisevoid/'$NAME'.jpg' | xclip -selection "clip-board"
fi
rm /tmp/$NAME.jpg