2011-03-04, 06:13
Adam
how about growlnotify for OSX ? I haven't looked at the changes for mythicalSetup, but here's a patch for librarian-notify-send
how about growlnotify for OSX ? I haven't looked at the changes for mythicalSetup, but here's a patch for librarian-notify-send
Code:
Index: librarian-notify-send
===================================================================
--- librarian-notify-send (revision 933)
+++ librarian-notify-send (working copy)
@@ -6,7 +6,9 @@
# Dependencies: lib-notify-bin Ubuntu: "sudo apt-get install lib-notify-bin"
user=`whoami`
-pids=`pgrep -u $user gnome-session`
+mythicalPlatform=`uname`
+
+
title=$1
text=$2
image=$3
@@ -22,11 +24,16 @@
timeout=60000
fi
-for pid in $pids; do
- # find DBUS session bus for this session
- DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS \
- /proc/$pid/environ | sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
- # send message to DBUS
- DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
- notify-send -u low -i "$image" "$title" "$text"
-done
+if [[ $mythicalPlatform == Darwin* ]]; then
+ growlnotify -m "$text" --image "$image"
+else
+ pids=`pgrep -u $user gnome-session`
+ for pid in $pids; do
+ # find DBUS session bus for this session
+ DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS \
+ /proc/$pid/environ | sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
+ # send message to DBUS
+ DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
+ notify-send -u low -i "$image" "$title" "$text"
+ done
+fi
\ No newline at end of file