[openbox] Quake-like-console configuration: problem with ForEach action
Martin Jiřička
mjiricka at gmail.com
Fri Jan 2 12:41:37 EST 2015
Hello!
I installed Openbox for the first time a few days ago. I was really
impressed how well a configuration process went. But in the end I had
a following problem.
I tried to configure a terminal window to act as something that was
somewhere called quake-like-console (i.e. an "adhoc" terminal that
appears after hitting some key above all windows and is available on
all desktops). I have already found some solution using external bash
script, but I think that following implementation would be more
elegant and maybe even more practical.
My idea is to start a terminal (urxvt in my case) with some special
title (like "quake_console"). Then create some rules for it:
<application name="urxvt" class="URxvt" title="quake_console">
<decor>no</decor>
<position force="yes">
<x>right</x>
<y>0</y>
</position>
<size>
<width>100%</width>
<height>40%</height>
</size>
<focus>yes</focus>
<desktop>all</desktop>
<layer>above</layer>
<iconic>no</iconic>
<skip_pager>yes</skip_pager>
<skip_taskbar>yes</skip_taskbar>
<fullscreen>no</fullscreen>
<maximized>no</maximized>
</application>
This works.
Now I need a key binding that would handle hiding and displaying of
the terminal. But the following snippet does not work:
<keybind key="W-w">
<!-- Find the terminal. -->
<action name="ForEach">
<title>quake_console</title>
<then>
<!-- Is it displayed? -->
<action name="If">
<desktop>current</desktop>
<then>
<!-- Hide it. -->
<action name="SendToDesktop">
<to>10</to>
<wrap>no</wrap>
<follow>no</follow>
</action>
</then>
<else>
<!-- Show it. -->
<action name="SendToDesktop">
<to>current</to>
<wrap>no</wrap>
<follow>no</follow>
</action>
</else>
</action>
</then>
</action>
</keybind>
And I do not understand where is a problem. I did not find any way how
to debug these rules. Documentation is not very helpful
(http://openbox.org/wiki/Help:Actions#If). In the doc is introduces a
"basic structure" of the If action, where is "query" element, but in
the examples below is no such element used, which puzzles me even
more.
I made some simpler tests and it looks like that "title" condition is
not working.
Can somebody give me a hint why the second snippet does not work please?
Best regards
Martin Jiřička
More information about the openbox
mailing list