The Citrix Dashboard Widget

I've been dealing with a packed schedule, a bunch of troubleshooting activities, altogether too little rest, and somehow, instead of reading or watching TV, here I am, at home, sitting at the computer.

Sure, that's pretty normal, but it so happens that, of all things, I'm writing a Dashboard widget.

Wait... You Said Dashboard?

Yes, I have finally found a use for the damn thing, and it is not your conventional useless pretty clicky lickable toy stuff.

No, it's something altogether different. You see, I've been tinkering with the Citrix Java client (which is the only way to get a seamless desktop and a system tray equivalent on Mac OS X until Citrix revamps their native client) and this morning I had one of those proverbial shower epiphanies -

Instead of running the Java client off Safari and risk closing the browser (or it crashing, which is most likely), why not hang it off Dashboard?

That way, at least, it's earning its keep in RAM and CPU time and I can invoke it quickly.

As it turns out, it works pretty well - using the com.citrix.ConnectionCenter applet, the notification area stays in Dashboard, and the Citrix desktop appears seamlessly merged with my Mac desktop. Here's how it looks:

Java child windows (which include the actual Citrix windows and configuration dialogs) appear on the desktop, and you'll notice the nice little Aqua shade...

I'm now at the stage where I'm learning to store preferences and generically muck about with user input, so the widget is pretty bland - but it already has an icon:

Wow! Where Can I Get It?

Whoa there. Before you start hammering my inbox or posting comments asking for it, be aware that there are a few things to figure out yet:

  • I still have to finish the configuration settings.
  • I still have to figure out how to configure and invoke the applet dynamically (just embedding it in the widget HTML works, but the Citrix documentation is incomplete in that regard, so I can't embed it and then trigger a connection - it just connects as soon as it's loaded, period). Just writing the applet tag using JavaScript should work, but that's still to be properly tested.
  • com.citrix.ConnectionCenter has a definite bug regarding session closure (it persists in redirecting the browser to close.html), and that seems to confuse Dashboard.
  • I have absolutely no idea how to go about distributing this. It's pretty obvious that Citrix has to provide permission for me to distribute the .jar files, but I still have to find a suitable contact for that.

If in doubt, I'll just publish the widget skeleton with instructions on how to drop in the Java bits.

But If you're in a hurry, this bit of HTML and the Java client download will get you started:

  <applet name="javaclient"
      <param name="Address" value="your_ica_server">
      <param name="TWIMode" value="on">
      <param name="TWIDragBoxType" value="solid">
      <param name="DesiredColor" value="4">
      <param name="Border" value="off">
      <param name="BorderWidth" value="0">
      <param name="Compress" value="on">
      <param name="MaximumCompression" value="on">
      <param name="PersistentCacheEnabled" value="on">
      <param name="InitialProgram" value="#Notepad">

Just open the Java client download, find the examples directory, and tweak one of them to look like the above. It's not rocket science, and you'll soon figure out why running it off Safari is less than ideal.

Ironically, I'm doing this so that myself and my Mac-enabled colleagues can work from home with minimal fuss - all it takes is a 3G connection and zero extra software (the widget is around 3MB so far, all things included).

Sometimes I wonder if I'm not trying too hard to make it easier to get my work done off-hours... Ah well. At least it's fun.

See Also: