Colin Harrington

Archive for May, 2009

Grails Growl-like notifications in Linux (Ubuntu, 9.04)

by on May.24, 2009, under General, Groovy-Grails, Linux, Ubuntu

When I was developing on OSX, a fellow developer Ted Naleid tipped me off to a script that does Growl notifications for Grails events that Marc Palmer had written.   The Growl notifications were handy, but now that I’ve been working on Linux, I’ve definitely missed them.

I first used a tool called Mumbles, which attempted to be a clone of Growl, but I later realized that the built in notification system is probably the way to go.  After I learned of Ubuntu 9.04 (Jaunty Jackalope) had some major visualization enhancements to the notifications, I thought that it was definitely the way to go. 

This is what I currently have with Ubuntu 9.04:

Jaunty Grails notification Plugins

Jaunty Grails notification final

Implementing this is very simple, you simply create an _Events.groovy file in your ~/.grails/scripts  directory (create it if it doesn’t exist) with the following contents (modified from the Growl Script):

eventStatusFinal = { msg ->
    libNotify('Final status', msg)
}
eventStatusUpdate = { msg ->
    libNotify('Status', msg)
}
eventCreatedFile = { fileName ->
    //libNotify('Created file', fileName)
}
eventStatusError = { message ->
    libNotify('Error', message)
}
eventExiting = { code ->
    libNotify('Exit', "Return code $code")
}
eventCreatedArtefact = { type, file ->
    libNotify('Created artefct', "$type with name $file")
}
eventCompileStart = { kind ->
    //libNotify('Compiling', "Compiling $kind")
}
eventCompileEnd = { kind ->
    //libNotify('Compilation complete', "Compiled $kind")
}
eventPluginInstalled = { pluginName ->
    libNotify('Plugin installed', pluginName)
}
// Do the notification
void libNotify(title, message) {
    def cmd = [
        'notify-send',
        title,
        message,
    '-i',
    'grails'
    ]
    cmd.execute()
}

It is simply using Groovy to execute "notify-send $title $message -i grails".   if you don’t have notify-send, it is part of libnotify so sudo apt-get install libnotify-bin will get you what you need.  If I get some time I’d like to find a way to take advantage of a Java Dbus implementation to talk to the notification system without having to go through libnotify.

If you want mumbles notifications just do something like this:

void mumblesNotify(title, message) {
    def cmd = [
        "mumbles-send",
           "-l",
        title,
        message
    ]
    cmd.execute()
}

Occasionally I’ll get a failure that there are too many files open (using .execute() in Groovy) and that should be cleared up by using a Java implementation of the DBus notifications.

Let me know what you think.  Anything that could be done better?

 

14 Comments :, , more...

Customizing rEFIt (an EFI Bootloader – Intel Macs) Slick!

by on May.05, 2009, under General, Linux, Logo, Ubuntu

I recently installed Ubuntu 9.04(Jaunty Jackalope) on a 17" Macbook pro and as a part of that process, I had to install a bootloader called rEFIt.  You could think of EFI is just a next-gen BIOS.

Even though the bootloader looks decent, I don’t like the look of silver/grey color, so I decided to customize it.  The process to customize rEFIt was relatively straight forward and the result is beautiful.

This is what I came up with:

background

This is what it looks like with a Windows Partition:

boot screen with 3 icons

I love the simplicity of it!!

Here is a closeup of the icons / OS Choices:

 

I don’t really know where the icons came from, but they look tasty :-)  On Linux there is a decent package for working with mac icons (.icns) or sudo apt-get install icnsutils  which will get you some useful tools (png2icns and icns2png)

I did have to make a few modifications to the Tux icon [os_linux.icns] to give him a ‘glow’ so that he doesn’t fade into the black on black:

Tux Crystal Modified by Colin

This windows Icon [os_win.icns] is the stock version I think (send me a link to the author if you know):

 

I did add a slight ‘glow’ to the apple icon [os_mac.icns] (send me a link to the author if you know):

I tried a number of custom ‘selected’ themes but gradients didn’t look right, so I went with the simple plan.  The selection bitmap can be found here:

selection_big.bmp

 

the process is simple once rEFIt is installed:  modify the refit.conf with the icons in place, and you are done!

Here is what I came up with for my refit.conf (comments removed):

timeout 5
banner hostname.bmp
selection_big   selection-big-ring.bmp
hideui tools shell funcs hdbadges label
legacyfirst

The original comments in the refit.conf file are helpful!  Its straight forward if you can read :-)

  • timeout = the number of seconds before it automatically chooses for you
  • banner = the bitmap of the upper part of the screen (top left pixel = background color)
  • selection_big = the grey ‘ring’ that indicated the selection
  • hideui = Hide elements of rEFIt so we can get a clean interface
  • legacyfirst = Legacy OS first (Linux)

Use at your own risk!!

If I had the time, it would be fun to build/enhance rEFIt to have an all-black fill instead of the grey/silver.

I’ve had a good experience with Ubuntu 9.04 on a 17" Macbook Pro, and I’ll Blog about it – and see what I can do to help update the documentation – look for an upcoming post.

 

34 Comments :, , , more...

Ubuntu Logo

by on May.03, 2009, under Linux, Logo, Ubuntu

I spent a little bit of time customizing rEFIt, which is an EFI Bootloader that  can be used on intel macs.  So far I like it.  Its not 100% feature complete (imho), but its open source :-)  

I found myself looking for a good logo for Ubuntu that it shows after you make your OS Choice in rEFIt.  There was plenty of good artwork on deviantart.com, but I decided to make my own :-)

So this is what I came up with based on one of the official logos:

Ubuntu Logo

Click to enlarge (668×668)

ps, I also have a post coming on customizing rEFIt (it looks juicy)

2 Comments :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!