On Sun, Nov 04, 2012 at 10:35:30AM -0200, Vitor Eiji Justus Sakaguti wrote:
> On Nov 3, 2012 1:14 PM, "Claudio Kozický" <[email protected]> wrote:
> > So I need to somehow detect, if the chromium window Awesome is about to
> > move was autorun or not.  Came up with this - autorun chromium with a
> > command like "echo 1 > .chromium-autorun && chromium", then when Awesome
> > sees a newly spawned chromium window, it checks .chromium-autorun (it's
> > a file) and if it finds "1" there, moves the chromium window to tag 3
> > and deletes the .chromium-autorun file, therefore preventing multiple
> > windows being moved. But the problem is that I have no idea how to make
> > Awesoem check the file *before* moving the window and removing the file.
> > Does anyone know how?
> 
> Use a callback instead of rule properties.

Thanks for the advice. I have finally achieved what I wanted. In case
somebody would want to do something similar, here's the rule:

  { rule = { instance = "chromium-autorun" },
    callback = function(c)
        local f = io.open(awful.util.getdir("config") .. "/chromium-autorun", 
"r")
        if f~=nill then
            awful.client.movetotag(tags[1][3], c)
            io.close(f)
            os.remove(awful.util.getdir("config") .. "/chromium-autorun")
        end
    end },

And before I autostart chromium, I just _touch_ the file.

-- 
Claudio Kozický

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

Reply via email to