2019-06-12 16:44:14 -07:00
|
|
|
#!/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
|
|
|
|
|
2019-06-10 20:30:49 -07:00
|
|
|
function run_spectacle
|
2020-08-31 17:45:21 -07:00
|
|
|
set f "/tmp/"(date "+%y%m%d-%H%M%S")".png"
|
2019-04-27 06:33:34 -07:00
|
|
|
|
2020-08-31 17:45:21 -07:00
|
|
|
spectacle -b $argv -n
|
2019-04-27 06:33:34 -07:00
|
|
|
|
2020-08-31 17:45:21 -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
|
2020-08-31 17:45:21 -07:00
|
|
|
rm "$f"
|
2019-07-05 19:09:01 -07:00
|
|
|
end
|
2019-06-10 20:30:49 -07:00
|
|
|
end
|