[openbox] Persisting a desktop terminal window across ToggleShowDesktop with xdotool - interesting failure mode

Dana Jansens danakj at orodu.net
Sun Mar 1 11:52:10 EST 2015


On Sun, Mar 1, 2015 at 3:31 AM, Paul G <paulg at perforge.net> wrote:

> To save the other 0.2 people who might try to do this in future several
> hours/days of their lives, I'll summarize: don't bother with a kludge and
> do it properly, namely by patching whatever it is you're trying to
> desktopify.
>
> Attempting to automatically re-map the window with xdotool will work in
> the sense that it'll remap it, you can then unhide it with wmctrl but
> you're still going to end up with it iconified unless/until you open
> another window (beforehand/). This is why it was working from the shell and
> not from the openbox config. I'm still curious to know why that is.
>
> Setting the WINDOW_TYPE_DESKTOP hint after the window is first mapped does
> not work. Not sure exactly why that is either, but it's contrary to spec,
> so no surprise there. I did not manage to find a way to set it before the
> window gets mapped in externally, although I've tried.
>
> In the end, I ended up doing what in hindsight I should've done earlier -
> patching tilda itself.
>
> Would a patch for being able to do it from an application config block in
> openbox make it in? If so, I might have a go as I think that's a more
> universal solution.
>

I think that would be a nice feature. I've seen people struggle with this
before for other apps.


>
> Cheers,
> -p
>
> On Sat, Feb 28, 2015 at 2:36 PM, Dana Jansens <danakj at orodu.net> wrote:
>
>> If you can force the window to be marked as TYPE_DESKTOP when it maps,
>> that would prevent it from hiding. Probably requires hacking the terminal
>> or openbox code to do that tho.
>>
>> On Sat, Feb 28, 2015 at 9:33 AM, Paul G <paulg at perforge.net> wrote:
>>
>>> I'm attempting to arrive at a working config for a transparent terminal
>>> window on the desktop. This works well except that it gets hidden with
>>> Super-D (ToggleShowDesktop), as one would expect. Having failed to find a
>>> way to protect the terminal window from being hidden by this, I moved on to
>>> trying to re-map it afterwards with xdotool. I've succeeded - but only
>>> partially - and this is where it gets interesting (for me, anyway).
>>>
>>> I can indeed successfully find the window with xdotool, I can map it
>>> again and everything looks great as long as I do so myself from the shell;
>>> when I attempt to have it happen automatically by sticking the same shell
>>> script into an Execute action (for the Super-D key binding *or* a different
>>> one), I get nada. The script runs, the log shows the window is found and
>>> xdotool returns 0, but nothing happens. I've tried adding a sleep up to 15s
>>> in case there's a race of some sort and still no luck.
>>>
>>> If someone can think of a different way to achieve the desired result
>>> I'd be chuffed. With that said, I'm sufficiently curious about why this is
>>> happening that I'm now more interested in finding that out than having a
>>> transparent desktop terminal ;)
>>>
>>> ForEach would not work for this even if I had it (i don't - using
>>> wheezy's 3.5.0-7 currently), since the terminal has two windows, of which
>>> only the second one needs to be re-mapped, and there doesn't appear to be a
>>> way to persist state across loop iterations.
>>>
>>> The details of my attempted set-up are as follows:
>>>
>>> openbox = 3.5
>>> tilda = 0.09.6
>>>
>>> relevant rc.xml snippets:
>>>
>>> <application name="tilda-desktop">
>>>       <focus>no</focus>
>>>       <layer>below</layer>
>>>       <desktop>All</desktop>
>>>       <skip_taskbar>yes</skip_taskbar>
>>>       <skip_pager>yes</skip_pager>
>>>       <decor>no</decor>
>>> </application>
>>>
>>>     <keybind key="W-d">
>>>       <action name="ToggleShowDesktop"/>
>>>       <action name="Execute">
>>> <command>bash /home/paul/show-tilda-desktop.sh &</command>
>>>   </action>
>>>     </keybind>
>>>     <keybind key="W-A-F5">
>>> <action name="Execute">
>>> <command>bash /home/paul/show-tilda-desktop.sh &</command>
>>>   </action>
>>>     </keybind>
>>>
>>> show-tilda-desktop.sh:
>>>
>>> #!/bin/bash
>>>
>>> sleep 15s
>>> echo -e "woke up..." > /tmp/show.log
>>> xdotool search --classname Tilda >> /tmp/show.log
>>> echo -e "running..." >> /tmp/show.log
>>> xdotool search --classname Tilda | awk 'BEGIN { RS = " "; FS = "\n" }
>>> {print $2}' | xargs -l1 xdotool windowmap
>>> echo -e "$?" >> /tmp/show.log
>>>
>>>
>>>
>>> Is there something obvious that I'm missing, say about the context
>>> Execute runs <command>s?
>>>
>>> Cheers,
>>> -p
>>>
>>> _______________________________________________
>>> openbox mailing list
>>> openbox at icculus.org
>>> http://icculus.org/mailman/listinfo/openbox
>>>
>>>
>>
>> _______________________________________________
>> openbox mailing list
>> openbox at icculus.org
>> http://icculus.org/mailman/listinfo/openbox
>>
>>
>
> _______________________________________________
> 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/20150301/88963322/attachment.html>


More information about the openbox mailing list