在Awesomewm中打开当前焦点屏幕标签中的程序,并使其保持持续性。

huangapple go评论53阅读模式
英文:

Open program in focused screen's tag and be persistent on it in Awesomewm

问题

在 awesomewm 中,每当我打开一个新的客户端时,它会在当前焦点的标签中打开,但如果我将焦点切换到另一个标签,它就会在那个标签中打开。

我希望它在我尝试生成它的当前标签中打开。

所以,如果我在标签 "1" 上,然后生成客户端 X,然后切换焦点到标签 "2",客户端 X 仍应在标签 "1" 中打开,即使客户端 X 有多个窗口要绘制,比如 Discord 有 2 个窗口(加载和实际应用程序)。

我找不到任何解决方法。

英文:

In awesomewm whenever I open a new client it opens in current focused tag, but If I move my focus to another tag it then opens in that tag.

I want it to open in my current tag where I tried to spawn it.

So, If I am on tag "1" and I spawn client X and then I switch focus to tag "2", client X should still open in tag "1" Even if the client X has multiple windows to draw for e.g discord has 2 windows ( loading and actual app).

I couldn't find anything.

答案1

得分: 0

awful.spawn()函数接受第二个参数,用于应用于已打开客户端的规则。

请参阅文档 https://awesomewm.org/doc/api/libraries/awful.spawn.html#spawn 以获取有关spawn函数以及在同一页面上较早的使用特定属性生成应用程序部分的详细信息。

您可以使用这些规则将特定标签强制应用于客户端:

awful.spawn("firefox", { tag = mouse.screen.selected_tag })

(请注意,仅当客户端支持启动通知协议时才有效。)

英文:

The awful.spawn() function takes a second parameter for rules to apply to the opened client.

See the documentation https://awesomewm.org/doc/api/libraries/awful.spawn.html#spawn for the spawn function and the Spawning applications with specific properties section earlier on this same page.

You can use these rules to force a specific tag to the client:

awful.spawn("firefox", { tag = mouse.screen.selected_tag })

(Note that it only works if the client supports the startup notifications protocol.)

huangapple
  • 本文由 发表于 2023年6月19日 13:01:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76503715.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定