Last active
December 3, 2015 16:27
Revisions
-
johnae revised this gist
Dec 3, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ like so: ``` cd ~ git clone https://gist.github.com/fc803fe80124a0fe1953.git ~/.spook/notifiers/ubuntu ``` Also make sure you install "notify-send" through apt or this won't work. -
johnae created this gist
Dec 3, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ This is an example Ubuntu notifier that can be used with [spook](https://github.com/johnae/spook) (a guard replacement - eg. watch for changes and run something). Clone this gist to: ``` ~/.spook/notifiers/ubuntu ``` like so: ``` cd ~ git clone https://gist.github.com/fc803fe80124a0fe1953.git .spook/notifiers/ubuntu ``` Also make sure you install "notify-send" through apt or this won't work. and you're good to go. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ display_notification = (status, icon, info) -> {:detail, :elapsed_time} = info os.execute "notify-send -i #{icon} \"#{status}: #{project_name!}\" \"#{detail} - #{elapsed_time}s\"" icon_pass = "starred" icon_fail = "software-update-urgent" pass_status = 'Tests passed' fail_status = 'Tests failed' runs = -> _, _, status = os.execute "which notify-send 2>&1 >/dev/null" status == 0 finish = (success, info) -> if success display_notification pass_status, icon_pass, info else display_notification fail_status, icon_fail, info :finish, :runs