Yes, it is less or more the same code as Uli posted, but there is no
need to use xproperty for that, startupid is being cached locally
anyway.
local wait_for_it = {}
local pid,snid = awful.util.spawn("urxvt")
wait_for_it[snid] = function()
print("will be called")
end
client.connect_signal("manage", function (c, startup)
if c.startup_id and wait_for_it[c.startup_id] then
wait_for_it[c.startup_id]()
end
end)
"will be called" will print when the client get managed
On 14 April 2014 14:32, Manuel Kasser <[email protected]> wrote:
> Hi,
>
> is there a way to check when a specific window shows up?
>
> Example: I'm spawning an urxvt with "urxvt -name myname" which spawns an
> urxvt with "myname" as content of the instance-variable.*
>
> Is there a way to execute code upon this window showing up? In this case
> I know that this will eventually happen, but instead of waiting a
> certain amount of time and working on this window then (e.g. guessing
> when it might be there) I'd like to do stuff with this window when it's
> there. Is there a more or less elegant way? (preferably nothing like
> "while client not there; search client" as this will be a lot of fun in
> this one rare situation when the urxvt isn't showing up for whatever
> reason and I'm completely locked out of my system).
>
> Cheers,
> Manuel
>
> *) While the xproperty-way is quite cool and worth keeping it in mind, I
> finally chose to do it this way as this is less code, less mistakes and
> thus more easily and more robust to implement.
>
> --
> To unsubscribe, send mail to [email protected].
>