Archive for August, 2009

emacs 23, dbus, and libnotify

A new major version of emacs is out, and it includes dbus support. This is great, because it means we can do things like this:

(require 'dbus)
(defun send-desktop-notification (summary body timeout)
  "call notification-daemon method METHOD with ARGS over dbus"
  (dbus-call-method
    :session                        ; use the session (not system) bus
    "org.freedesktop.Notifications" ; service name
    "/org/freedesktop/Notifications"   ; path name
    "org.freedesktop.Notifications" "Notify" ; Method
    "emacs"
    0
    ""
    summary
    body
    '(:array)
    '(:array :signature "{sv}")
    ':int32 timeout))

(defun pw/compile-notify (buffer message)
  (send-desktop-notification "emacs compile" message 0))

(setq compilation-finish-function 'pw/compile-notify)

Add this to your .emacs file and you will receive a libnotify popup when M-x compile completes. It will even give you the exit message, so you know whether the compile was successful.

So now you can let that long compile run, and work on something else. emacs will let you know when the compile finishes.

As written above, the notifications will stay on your screen until you dismiss them (by clicking on them). If you would like them to vanish after a preset time limit, change the 0 in the call to send-desktop-notification. Set it to the number of milliseconds the popup should remain on the screen.

Screenshot of libnotify popup showing a compiler error

Screenshot of libnotify popup showing a compiler error

This is just the tip of the iceberg, of course. Any application that presents a dbus interface can be interacted with from emacs, which means that emacs can also integrate itself with the Linux desktop in other interesting ways.

Comments (1)

so close, Netflix

I like Netflix. I think they’re a great service, reasonably priced, and they have completely replaced cable television for me. However, I have found one problem. According to Netflix:

If you are renting a series or seasons, we will ship the DVDs in order. That means:

* If there is a wait for a particular DVD in a series, will we wait until we ship you that DVD until we ship the next DVD in that series.

Which is great. If I add, say, Excel Saga to my queue, I can be certain that I will get disc 1 first, followed by disc 2 and 3. Under no circumstances will I have to worry about getting, say, disc 4 before disc 2. Right?

Well, in theory. In practice, some TV series (notably, Excel Saga) have discs missing completely. These discs go into your “Saved DVDs” list instead of your queue, and they aren’t considered to be discs with a “wait”. As a result, they get skipped over completely, and you get the next disc in the series that isn’t missing.

Why am I complaining here instead of directly to Netflix? Because Netflix doesn’t have any reasonable way that I can find to open a bug report or provide feedback. And I wanted to vent a little.

Leave a Comment

The Decentralized Metaverse

Several years ago I mused on the decentralization of Second Life, Linden Labs’ virtual world. Shortly after that post, I dropped out of the metaverse entirely for more than a year.

While I was off not paying attention, it seems that almost all of my predictions have come true. An open-source server for running a simulator and/or grid, OpenSim, has been created. OpenSim appears to have solved many of the problems, and implemented many of the predictions, of my post from 2006.

One “problem” that remains, though, is economy.
Read the rest of this entry »

Leave a Comment

d20tools 0.3 is here

I’ve released a new version of d20tools. In addition to using a new, simpler file saving/loading scheme and better keyboard handling, the new feature is also a lot more stable. Other highlights include a more sensible entity/group management system, and the ability for any creature to be a henchman.

Get it here.

I’m lifting my moratorium on D&D 4e, as well. This means that d20tools will eventually support 4e creatures. However, this is a huge undertaking, and I have to decide how best to handle it. I’m leaning towards a system that will allow anyone to write system templates; then, any gaming system could be plugged in, theoretically. In practice, this is a lot of work for a single developer, so I wouldn’t anticipate this happening any time soon.

Leave a Comment

Follow

Get every new post delivered to your Inbox.

Join 136 other followers