scripts/sshot/sharenix

23 lines
458 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env fish
2019-04-27 06:33:34 -07:00
2019-06-18 06:20:27 -07:00
function notify
2019-07-05 19:09:01 -07:00
notify-send -a sharenix -i dialog-information $argv
2019-06-18 06:20:27 -07:00
end
function run_spectacle
set f "/tmp/"(date "+%y%m%d-%H%M%S")".png"
2019-04-27 06:33:34 -07:00
spectacle -b $argv -n
2019-04-27 06:33:34 -07:00
if test -f "/tmp/temp.png"
mv "/tmp/temp.png" "$f"
2019-07-05 19:09:01 -07:00
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"
2019-07-05 19:09:01 -07:00
end
end