On 2013-04-25, Uli Schlachter <[email protected]> wrote:
> P.S.: You don't need wmctrl to find a window by pid:
>
> function find_by_pid(pid)
>    for _, c in pairs(client.get()) do
>      if c.pid == pid then return c end
>    end
> end

Here I attempt to first spawn and then catch the window by pid, but I
seem to lock the spawning here? The xclock window, along with "timedout"
pops up only after 5 seconds has passed.

  pid = awful.util.spawn("xclock")
  begin = os.time()
  found = false
  while not found and os.difftime(os.time(), begin) < 5 do
    for i, c in pairs(client.get()) do
      if c.pid == pid then
        wmnotify("hola")
        found = true
        break
      end
    end
  end
  if not found then
    wmnotify("timedout")
  end


-- 
To unsubscribe, send mail to [email protected].

Reply via email to