dmenu openbox keybindings syntax problem?

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

dmenu openbox keybindings syntax problem?

Post by globetrotterdk »

I have just installed Salix OS LXDE 13.37 and am trying to get dmenu to work with the openbox keybindings in /home/user/.config/openbox/lxde-rc.xml I have set some keybindings to open programs that work, but dmenu doesn't want to cooperate for some reason. When I run alt-f2

Code: Select all

dmenu_run -i -nb '#000000' -nf '#FFFFFF'
I have no problem getting dmenu to appear. However, the following doesn't work when included in the file:

Code: Select all

<!-- Keybindings for dmenu-->
    <keybind key="A-F3">
      <action name="Execute">
        <command>dmenu_run -i -nb '#000000' -nf '#FFFFFF'</command>
      </action>
    </keybind>
I assume there is some problem with the syntax, but I can't find where the problem is. Any ideas?
Last edited by globetrotterdk on 4. Jan 2012, 12:31, edited 2 times in total.
Military justice is to justice what military music is to music. - Groucho Marx
kinslayer
Posts: 18
Joined: 1. Jul 2011, 01:55

Re: dmenu openbox keybindings syntax problem?

Post by kinslayer »

Could it be that you have the keybinding set to Alt-F3 and not Alt-F2. Not sure if this could be the problem, but you say dmenu doesn't open when you press Alt-F2 yet the code you posted shows it is bound to A-F3.
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: dmenu openbox keybindings syntax problem?

Post by globetrotterdk »

kinslayer wrote:Could it be that you have the keybinding set to Alt-F3 and not Alt-F2. Not sure if this could be the problem, but you say dmenu doesn't open when you press Alt-F2 yet the code you posted shows it is bound to A-F3.
Thanks for the reply. No, that is a typo. I'll change that right now.

I have been doing more research and it seems that dmenu performs differently from distro to distro, despite the same base. Crunchbang, Zenix and Lubuntu are all distros based on Debian, but Crunchbang links from the key binding in openbox, to a dmenu script, while Zenix and Lubuntu appear to only use a key binding in openbox. This suggests to me that dmenu was compiled differently in the individual distros or that patches were applied.

My next step is to try to link the key binding in Salix to the Crunchbang script and see what happens. BTW here is what the script looks like:

Code: Select all

#!/bin/bash
exe=`dmenu_path | dmenu -b -nb '#151617' -nf '#d8d8d8' -sb '#d8d8d8' -sf '#151617'` && eval "exec $exe"
and here is the key binding used in Crunchbang to call the script:

Code: Select all

    <keybind key="A-F3">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>dmenu-bind</name>
        </startupnotify>
        <command>~/.config/dmenu/dmenu-bind.sh</command>
      </action>
    </keybind>
A work around for this whole issue would have been to use AutoKey http://autokey.googlecode.com/, but it is unfortunately not available in Salix OS.
Military justice is to justice what military music is to music. - Groucho Marx
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: dmenu openbox keybindings syntax problem?

Post by globetrotterdk »

kinslayer wrote:Could it be that you have the keybinding set to Alt-F3 and not Alt-F2. Not sure if this could be the problem, but you say dmenu doesn't open when you press Alt-F2 yet the code you posted shows it is bound to A-F3.
Sorry, that wasn't a typo after all. The point is that I can run the command inside the alt-F2 run command, so I know it works, but it doesn't work when included in an openbox key binding. I use alt-F3, which is the key binding usually used for dmenu on the distros that I have used.

I have just tried the Crunchbang solution with the bash script, and that doesn't work either, so this probably isn't an issue of compiling or patching dmenu. Very strange.
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: dmenu openbox keybindings syntax problem?

Post by Shador »

Did you reload openbox settings (e.g. openbox --reconfigure)?
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: dmenu openbox keybindings syntax problem?

Post by globetrotterdk »

Shador wrote:Did you reload openbox settings (e.g. openbox --reconfigure)?
Yes. No luck.
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: dmenu openbox keybindings syntax problem?

Post by Shador »

I think there's some logfile in the user dir which your login manager creates. This should contain output from openbox. Not sure though cause I'm using no login manager and thus in my setup I get that output by starting with startx.
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: dmenu openbox keybindings syntax problem?

Post by globetrotterdk »

Shador wrote:I think there's some logfile in the user dir which your login manager creates. This should contain output from openbox. Not sure though cause I'm using no login manager and thus in my setup I get that output by starting with startx.
I found this in .xsession-errors:

Code: Select all

Openbox-Message: Failed to execute child process "/home/user/.config/dmenu/dmenu-bind.sh" (Permission denied)
dmenu: warning: no locale support
I also found this at the beginning of the file:

Code: Select all

/etc/gdm/Xsession: Beginning session setup...
/etc/gdm/Xsession: Setup done, will execute: /usr/bin/ssh-agent -- /usr/bin/startlxde
cp: cannot stat `/usr/share/lxde/pcmanfm/pcmanfm.conf': No such file or directory
Openbox-Message: X server does not support locale.
Openbox-Message: Cannot set locale modifiers for the X server.
Any ideas how to solve this problem?
Military justice is to justice what military music is to music. - Groucho Marx
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: dmenu openbox keybindings syntax problem?

Post by Shador »

Is the script you created executable? Or whatever may be wrong with them?

The second extract doesn't seem to matter. Nothing seems to go wrong there and if you don't notice any problem. So it probably doesn't indicate any problem.
Image
User avatar
globetrotterdk
Posts: 435
Joined: 26. Oct 2010, 13:57
Location: Denmark

Re: dmenu openbox keybindings syntax problem?

Post by globetrotterdk »

Shador wrote:Is the script you created executable? Or whatever may be wrong with them?

The second extract doesn't seem to matter. Nothing seems to go wrong there and if you don't notice any problem. So it probably doesn't indicate any problem.
OK, it looks like I solved the problem. It was obvious considering the error message, but I still don't understand the connection with dmenu. The system apparently doesn't like being set to "English locale for Denmark". As soon as I changed the locale and ran

Code: Select all

openbox --reconfigure
I was able to get the original key binding running without the script.
Military justice is to justice what military music is to music. - Groucho Marx
Post Reply