scripts/sshot/sharenix

23 lines
458 B
Fish
Executable File

#!/usr/bin/env fish
function notify
notify-send -a sharenix -i dialog-information $argv
end
function run_spectacle
set f "/tmp/"(date "+%y%m%d-%H%M%S")".png"
spectacle -b $argv -n
if test -f "/tmp/temp.png"
mv "/tmp/temp.png" "$f"
notify -u low -c transfer "Uploading..."
if sharenix -s Greyserv "$f"
notify -u low -c transfer.complete "Upload completed"
else
notify -u normal -c transfer.error "Upload failed"
end
rm "$f"
end
end