scripts/sshot/sharenix

23 lines
439 B
Plaintext
Raw 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
2019-07-05 19:09:01 -07:00
set f "$HOME/Pictures/"(date "+%y%m%d-%H%M%S")".png"
2019-04-27 06:33:34 -07:00
2019-07-05 19:09:01 -07:00
spectacle -b $argv -n -o "$f"
2019-04-27 06:33:34 -07:00
2019-07-05 19:09:01 -07:00
if test -f "$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
end
2019-04-27 06:33:34 -07:00
2019-07-05 19:09:01 -07:00
rm "$f"
end