2013-02-22 26 views
5

我已阅读Setting windows layout for a specific application in awesome-wm。现在我想在自动启动期间在特定标签下执行此操作。 例如:应用程序在特定的标签下自动启动awesome-wm

我打开我的pc.Apps像“火狐”,“终端”,将下标签1”‘的mplayer’自动运行将在标签2运行‘XChat的’将下运行标记3.他们都自动启动

我不想让“firefox”始终在标签1下。我可以在我想要的任何标签下运行firefox。我只需要在计算机第一次打开时运行在标签1下方。下面的代码无法使用。

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

回答

2

退房shifty - 您可以指定应用程序的选项卡,但仍然可以将其移至不同的选项卡。

+0

谢谢你.Shifty非常方便。 – winoi 2013-03-05 08:21:14

+0

[tyrannical](https://github.com/Elv13/tyrannical)可以干净地处理动态标签管理和应用程序启动规则 – krd 2015-02-07 08:10:30

5

你看过很棒的维基页面吗?我认为这是你正在寻找的:

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”),然后创建一个规则,在屏幕上只启动名为“startup”的实例。

例子:

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

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

非常感谢@nyquist,我正在寻找如何做到这一点。我会尽快尝试。 – Ciges 2014-01-22 08:50:19