Re: [wmii] dmenu mpd client

From: Christian G. Warden <cwarden_AT_xerus.org>
Date: Thu, 11 Oct 2007 15:49:46 -0700

On Thu, Oct 11, 2007 at 03:34:15PM -0700, Christian G. Warden wrote:
> On Wed, Oct 10, 2007 at 09:36:09PM +0200, Johannes Krude wrote:
> > Am Mittwoch 10 Oktober 2007 schrieb Christian G. Warden:
> > > I get the following when trying to run mpd-dmenu:
> > > MPD_HOST="localhost" mpc --no-status
> > > sh: -c: line 29: syntax error: unexpected end of file
> >
> > Thats weird. on line 29 is only an assignment
> > and why is sh complaining and not ruby
> >
> > > The status script runs, but shows the contents of $WMII_NORMCOLORS in
> > > the status bar.
> >
> > Are you using a bleding edge version of wmii, where they changed the API or
> > something?
> > I'm not that much into wmii, I just copied it from the original status.
> > I'm using wmii-3.6_rc2 from gentoo and it's working perfectly for me.
>
> I don't grok ruby, but it seems "#{$dmenu}" is not being expanded
> properly. Here's what's getting run:
> execve("/bin/sh", ["sh", "-c", "echo \"add\nclear\ncrop\ncrossfade\ndisable\nenable\nload\nmove\nnext\noutputs\npause\nplay\nplaylist\nplaylists\nprevious\nrandom on\nremove\nremove_playlist\nrepeat on\nsave\nsearch\nsearch_one\nseek\nshuffle\nstats\nstop\nupdate\nversion\nvolume\" | "], [/* 125 vars */]) = 0
>
> If I replace "#{$dmenu}" with "dmenu -b" it works properly:
> execve("/bin/sh", ["sh", "-c", "echo \"add\nclear\ncrop\ncrossfade\ndisable\nenable\nload\nmove\nnext\noutputs\npause\nplay\nplaylist\nplaylists\nprevious\nrandom on\nremove\nremove_playlist\nrepeat on\nsave\nsearch\nsearch_one\nseek\nshuffle\nstats\nstop\nupdate\nversion\nvolume\" | dmenu -b"], [/* 125 vars */]) = 0

Here's a simpler fix:
--- mpd-dmenu-2007.09.29 2007-09-29 03:20:42.000000000 -0700
+++ mpd-dmenu 2007-10-11 15:47:06.000000000 -0700
@@ -23,7 +23,7 @@
        list.find { |x| `MPD_HOST="#{x}" mpc>/dev/null; echo -n $?`=="0" }
 end

-$dmenu= ENV["DMENU"] or "dmenu -b"
+$dmenu= ENV["DMENU"] || "dmenu -b"
 $hosts= ["localhost", "musicbox", "trillian"]
 $host= (ENV["MPD_HOST"] or find_mpd_host($hosts))
 $mpc= "MPD_HOST=\"#{$host}\" mpc --no-status"
@@ -133,7 +133,7 @@
        when /^repeat (on|off)$/
                mpc("repeat", $1)
        when "save"
- mpc("save", `echo | #{dmenu}`)
+ mpc("save", `echo | #{$dmenu}`)
        when /^save (.+)$/
                mpc("save", $1)
        when "search"
Received on Fri Oct 12 2007 - 00:49:57 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:29:39 UTC