[dev] p9-style dmenu_run

From: Connor Lane Smith <cls_AT_lubutu.com>
Date: Mon, 24 Jan 2011 14:05:13 +0000

Hey all,

Just thought I'd throw this out here in case anyone's interested. In
modern Linux you can use FUSE to make a Plan 9-style union filesystem,
which means you can actually get rid of dmenu_path completely. (Thanks
to __20h__ in #suckless for this idea.)

$ sudo apt-get install unionfs-fuse # or distro equivalent
$ mkdir ~/path
$ unionfs $PATH ~/path

Now you can change your dmenu_run and throw away dmenu_path:

diff -r c2e77ee26371 dmenu_run
--- a/dmenu_run Fri Jan 07 18:55:00 2011 +0000
+++ b/dmenu_run Mon Jan 24 13:49:24 2011 +0000
@@ -1,2 +1,2 @@
 #!/bin/sh
-exe=`dmenu_path | dmenu ${1+"$@"}` && exec $exe
+exe=`ls ~/path | dmenu ${1+"$@"}` && exec $exe

I don't know how it compares wrt speed, but unionfs appears to cache
it for us. Still, it's more 'cool' than 'useful'. (And completely
unportable.)

Linux 2.6 also has Plan 9's per-process namespaces, but they're only
available to root as of yet. Still, in the future maybe we'll be able
to exploit the kernel to get the best of both worlds.

cls
Received on Mon Jan 24 2011 - 15:05:13 CET

This archive was generated by hypermail 2.2.0 : Mon Jan 24 2011 - 15:12:03 CET