[openbox] Quake-like-console configuration: problem with ForEach action

Dana Jansens danakj at orodu.net
Fri Jan 2 15:34:55 EST 2015


On Fri, Jan 2, 2015 at 12:28 PM, Dana Jansens <danakj at orodu.net> wrote:

> On Fri, Jan 2, 2015 at 9:41 AM, Martin Jiřička <mjiricka at gmail.com> wrote:
>
>> 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.
>>
>
> Here's the code that does the parsing. It looks for a <query> and uses the
> current target window if no <query> exists.
> https://github.com/danakj/openbox/blob/master/openbox/actions/if.c#L256
>
> Sounds like the examples are wrong.
>


Mmmm... going to have to take that back.  How it works is the <query> node
lets you define the target window which you are making those queries
against. Without the query node it uses the default target, and looks for
tests under the if node instead.

It feels like there may be a bug here though. If you put the tests in a
<query> with target="default" then does it work?

I think
https://github.com/danakj/openbox/blob/master/openbox/actions/if.c#L261
should be |node->children| instead of just |node|..


>
>
>>
>> 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
>> _______________________________________________
>> openbox mailing list
>> openbox at icculus.org
>> http://icculus.org/mailman/listinfo/openbox
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/openbox/attachments/20150102/3ba45ea6/attachment-0001.html>


More information about the openbox mailing list