Created
October 16, 2012 20:00
-
-
Save noamross/3901621 to your computer and use it in GitHub Desktop.
BashGrowl: Run Command in Bash and display output as Growl Notificaiton
This file contains 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 characters
# Save this in ~/Libary/Application Support/Quicksilver/Actions and relaunch | |
# Quicksilver. Then just enter a text bash command and activate "BashGrowl" in | |
# the second pane. I like it for todo.txt and system status calls. | |
using terms from application "Quicksilver" | |
on process text theCommand | |
set _text to do shell script "/bin/bash -ic " & quoted form of theCommand | |
try | |
tell application "System Events" | |
set _growlIsRunning to ¬ | |
(count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 | |
end tell | |
if _growlIsRunning = true then | |
-- Change "QuickPad" to any title you like… | |
set _title to "QuickGrowl" | |
my _growl(_title, _text, true) | |
else | |
tell application "Quicksilver" | |
activate | |
display dialog "Growl isn't running." | |
end tell | |
end if | |
on error a number b | |
tell application "Quicksilver" | |
activate | |
display dialog a | |
end tell | |
end try | |
end process text | |
end using terms from | |
on _growl(_title, _text, _sticky) | |
tell application id "com.Growl.GrowlHelperApp" | |
set the allNotificationsList to {"Notification 1", "Notification 2"} | |
set the enabledNotificationsList to {"Notification 1"} | |
register as application "Quicksilver AppleScript notifications" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Quicksilver" | |
notify with name "Notification 1" title _title description _text application name "Quicksilver AppleScript notifications" icon of application "Quicksilver" sticky _sticky | |
end tell | |
end _growl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment