Autostart application under a specific tag in awesome-wm

I read Configuring the window layout for a specific application in awesome-wm . Now I want to do this under a specific tag during autorun. For instance:

I include pc.Apps, for example, "firefox", "terminal" will automatically start under tag 1. "mplayer" will work under tag 2. "xchat" will work under tag 3. All of them will automatically start.

     

I do not want "firefox" to always be under tag 1. I could run firefox under any tags that I want. I just need it to start under tag 1 when the computer is first turned on. So the code below cannot be used.

awful.rules.rules = {
-- All clients will match this rule.
{ rule = { class = "Firefox" },
 properties = { tag = tags[1][2]}}, --,switchtotag=true} },
 ...
+5
source share
3

shifty - , .

+2

? , , :

   function run_once(prg,arg_string,pname,screen)
    if not prg then
        do return nil end
    end

    if not pname then
       pname = prg
    end

    if not arg_string then 
        awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. "' || (" .. prg .. ")",screen)
    else
        awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. " ".. arg_string .."' || (" .. prg .. " " .. arg_string .. ")",screen)
    end
end

run_once("xscreensaver","-no-splash")
run_once("pidgin",nil,nil,2)
run_once("wicd-client",nil,"/usr/bin/python2 -O /usr/share/wicd/gtk/wicd-client.py")

awesome wiki. . . . , (exp. "Startup" ), "" .

:

run_once("firefox","startup, nil, 1)

...
 rule = { class = "Firefox", instance = "startup" }, properties = {tag = tags[2]}},
...
+5

I created a small tool to accomplish this task with pure lua in Awesome features and don't need plugins!

https://gist.github.com/Flowkap/8858434

+1
source

All Articles