<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 2, 2015 at 9:41 AM, Martin Jiřička <span dir="ltr"><<a href="mailto:mjiricka@gmail.com" target="_blank">mjiricka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello!<br>
<br>
I installed Openbox for the first time a few days ago. I was really<br>
impressed how well a configuration process went. But in the end I had<br>
a following problem.<br>
<br>
I tried to configure a terminal window to act as something that was<br>
somewhere called quake-like-console (i.e. an "adhoc" terminal that<br>
appears after hitting some key above all windows and is available on<br>
all desktops). I have already found some solution using external bash<br>
script, but I think that following implementation would be more<br>
elegant and maybe even more practical.<br>
<br>
My idea is to start a terminal (urxvt in my case) with some special<br>
title (like "quake_console"). Then create some rules for it:<br>
<br>
  <application name="urxvt" class="URxvt" title="quake_console"><br>
    <decor>no</decor><br>
    <position force="yes"><br>
      <x>right</x><br>
      <y>0</y><br>
    </position><br>
<br>
    <size><br>
      <width>100%</width><br>
      <height>40%</height><br>
    </size><br>
<br>
    <focus>yes</focus><br>
    <desktop>all</desktop><br>
    <layer>above</layer><br>
    <iconic>no</iconic><br>
    <skip_pager>yes</skip_pager><br>
    <skip_taskbar>yes</skip_taskbar><br>
    <fullscreen>no</fullscreen><br>
    <maximized>no</maximized><br>
  </application><br>
<br>
This works.<br>
<br>
Now I need a key binding that would handle hiding and displaying of<br>
the terminal. But the following snippet does not work:<br>
<br>
  <keybind key="W-w"><br>
    <!-- Find the terminal. --><br>
    <action name="ForEach"><br>
      <title>quake_console</title><br>
      <then><br>
        <!-- Is it displayed? --><br>
        <action name="If"><br>
          <desktop>current</desktop><br>
          <then><br>
            <!-- Hide it. --><br>
            <action name="SendToDesktop"><br>
              <to>10</to><br>
              <wrap>no</wrap><br>
              <follow>no</follow><br>
            </action><br>
          </then><br>
          <else><br>
            <!-- Show it. --><br>
            <action name="SendToDesktop"><br>
              <to>current</to><br>
              <wrap>no</wrap><br>
              <follow>no</follow><br>
            </action><br>
          </else><br>
        </action><br>
      </then><br>
    </action><br>
  </keybind><br>
<br>
And I do not understand where is a problem. I did not find any way how<br>
to debug these rules. Documentation is not very helpful<br>
(<a href="http://openbox.org/wiki/Help:Actions#If" target="_blank">http://openbox.org/wiki/Help:Actions#If</a>). In the doc is introduces a<br>
"basic structure" of the If action, where is "query" element, but in<br>
the examples below is no such element used, which puzzles me even<br>
more.<br></blockquote><div><br></div><div>Here's the code that does the parsing. It looks for a <query> and uses the current target window if no <query> exists. <a href="https://github.com/danakj/openbox/blob/master/openbox/actions/if.c#L256">https://github.com/danakj/openbox/blob/master/openbox/actions/if.c#L256</a></div><div><br></div><div>Sounds like the examples are wrong.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
I made some simpler tests and it looks like that "title" condition is<br>
not working.<br>
<br>
Can somebody give me a hint why the second snippet does not work please?<br>
<br>
<br>
Best regards<br>
<span class=""><font color="#888888">Martin Jiřička<br>
_______________________________________________<br>
openbox mailing list<br>
<a href="mailto:openbox@icculus.org">openbox@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/openbox" target="_blank">http://icculus.org/mailman/listinfo/openbox</a><br>
</font></span></blockquote></div><br></div></div>