这是我现在使用的代码:awful.rules.rules = {...{ rule = { class = "Pidgin", role = "buddy_list" },属性 = {浮动 = 真},回调 = 函数( c )本地 w_area = screen[ c.screen ].workarea本地窗口宽度 = 340c:struts({ right = winwidth } )c:geometry({ x = w_area.width - winwidth, width = winwidth, y = w_area.y, height = w_area.height } )结尾},{ rule = { class = "Pidgin", role = "conversation" },属性 = {浮动 = 真,x = 0,最大化垂直 = 真,最大化水平 = 真},回调 = 可怕的.client.setslave},...} 解决方案 我遇到了完全相同的问题,但我希望左侧有一个大的 Firefox 窗口,右侧有一个小终端.为了让它工作,我为此专门使用了一个带有 tile-left 布局的标签并调整了宽度因子(即通常由 CTRL-L 执行的操作).将以下内容添加到 rc.lua 的末尾,其中 yourtag 是您想要放置这些窗口的标签.0.15 值可以根据您的喜好进行调整.awful.tag.viewonly(你的标签)可怕的.tag.incmwfact(0.15,你的年龄)此外,对右侧所需的窗口使用 awful.client.setslave 可确保它们不会被切换.{规则 = { class = "URxvt" },回调 = 可怕的.client.setslave},您还可以使用 tag 属性将某些应用程序定向到标签.{规则 = { class = "Firefox" },属性 = { 标签 = 浏览 }},{rule = { class = "URxvt", instance = "browse" },属性 = { 标签 = 浏览 },},然后我创建了一个绑定来打开这些应用程序,如下所示.-- 自定义程序可怕的.key({ modkey, "Shift" }, "b", function()可怕的.tag.viewonly(浏览)可怕的.util.spawn_with_shell("urxvt -name browse -e newsbeuter")可怕的.util.spawn(火狐")结尾)这是最终结果:How to config awesome so it would start new application with two windows aligned like this:----------------|xxxxxxxxxx####||xxxxxxxxxx####||xxxxxxxxxx####||xxxxxxxxxx####|----------------where "x" is for example conversation window in pidgin and '#' is buddy list window.In general I would like to specify width of right window and put it on the right side (maximized vertically) and the other window should take the remaining space.I already have some almost-working code, but it behaves strangely (it setups everything correct for pidgin, but it doesn't for gimp and v_sim, and occasionally without any known to me reason it changes geometry of the left window. Or when I start application (v_sim) it isn't placed in correct positions and it isn't maximized vertically, but when I then restart awesome, it places it correctly. So I guess that this application changes something when it starts.Here is code which I use now:awful.rules.rules = { ... { rule = { class = "Pidgin", role = "buddy_list" }, properties = { floating = true }, callback = function( c ) local w_area = screen[ c.screen ].workarea local winwidth = 340 c:struts( { right = winwidth } ) c:geometry( { x = w_area.width - winwidth, width = winwidth, y = w_area.y, height = w_area.height } ) end }, { rule = { class = "Pidgin", role = "conversation" }, properties = { floating = true, x = 0, maximized_vertical = true, maximized_horizontal = true }, callback = awful.client.setslave }, ...} 解决方案 I had this exact same problem, but I wanted a large Firefox window on the left with a small terminal on the right. To get it to work I dedicated a tag for this purpose with a tile-left layout and adjusted the width factor (i.e. the operation normally performed by CTRL-L).Add the following to the end of rc.lua where yourtag is the tag in which you would like to place these windows. The 0.15 value can be adjusted to your taste.awful.tag.viewonly(yourtag)awful.tag.incmwfact(0.15, yourtage)Also, using the awful.client.setslave for the window that you want on the right ensures that they don't get switched.{ rule = { class = "URxvt" }, callback = awful.client.setslave},You may also direct certain applications to a tag using the tag property.{ rule = { class = "Firefox" }, properties = { tag = browse }},{ rule = { class = "URxvt", instance = "browse" }, properties = { tag = browse },},I then created a binding to open these applications as follows.-- Custom programsawful.key({ modkey, "Shift" }, "b", function() awful.tag.viewonly(browse) awful.util.spawn_with_shell("urxvt -name browse -e newsbeuter") awful.util.spawn("firefox")end)This is the final result: 这篇关于在 awesome-wm 中为特定应用程序设置窗口布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!