Skip to content

Instantly share code, notes, and snippets.

@noamross
Created October 16, 2012 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noamross/3901621 to your computer and use it in GitHub Desktop.
Save noamross/3901621 to your computer and use it in GitHub Desktop.
BashGrowl: Run Command in Bash and display output as Growl Notificaiton
# 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