You are not logged in.

#1 2014-01-05 17:33:29

ExoDoom
Member
Registered: 2013-11-01
Posts: 39

Close/know if an Openbox menu is opened

Hi all!

I'm tryíng to simulate a start menu from a launcher in tint2-svn. I want it to open right above tint2, either when I click the launcher or when Super_L key is pressed. I also have an "open menu right here" bound to Ctrl+Super_L. This is what I've done:

In rc.xml, I have these lines:

    <keybind key="Super_L">
      <action name="Execute">
        <command>lanzar menu</command>
      </action>
    </keybind>
    <keybind key="C-Super_L">
      <action name="ShowMenu">
        <menu>root-menu</menu>
      </action>
    </keybind>

"lanzar" is a script that makes all my dirty work. "lanzar menu" just runs

xdotool mousemove 0 $(( `xrandr | grep '*' | cut -dx -f2 | cut -d\  -f1` - `grep panel_size ~/.config/tint2/tint2rc | cut -d\  -f4` )) key Ctrl+Super_L mousemove restore

In my tint2rc,

launcher_item_app = /home/exodoom/.config/tint2/tint2menu.desktop

refers to a .desktop file with

Exec=lanzar menu

Everything works as expected. Shall I press Super_L or click the launcher, the menu opens in the correct position. However, I'd like a second click (or key press) to close the menu, not to open a new one. Is there any way to check if root-menu (or whatever) is opened? If so, is there a way to close it (I mean a more elegant way than xdotool key Escape)?

Thanks in advance.

Offline

Board footer

Powered by FluxBB