You are not logged in.
Hi All!
I use theme.border_width = "1". But I want a maximized and fullsrceen window to has border_width = "0" so I wrote this trcik:
awful.key({ modkey, }, "m",
function (c)
if c.maximized_vertical then
c.border_width = 1
else
c.border_width = 0
end
c.maximized_horizontal = not c.maximized_horizontal
c.maximized_vertical = not c.maximized_vertical
end)But there is a problem: when an application starts already in maximized state it has a border = "1".
How can it be solved? Maybe by signals?
Last edited by gray85 (2011-02-27 09:18:12)
Offline
Do it all in the arrange signal. You can add it to the bottom of your rc.lua
-- {{{ Arrange signal handler
for s = 1, screen.count() do screen[s]:add_signal("arrange", function ()
local clients = awful.client.visible(s)
for _, c in pairs(clients) do
if #clients == 1 then clients[1].border_width = 0
else c.border_width = beautiful.border_width end
end
end)
end
-- }}}Last edited by anrxc (2011-02-23 21:31:15)
You need to install an RTFM interface.
Offline
anrxc, thank you! but it does not work for me, nothing happens... When I start firefox, it starts in maximized state, but it has a border.
Unfortunately I do not know what "arrange" signal does and do not understand what "for _, c in pairs(clients)" means ![]()
Offline
Been thinking of the same thing but never got around to give it a go before...
gray85:
Anrxc tip didn't work for me either but I suspected that conky might be the reason by being counted as a client so that #clients == 0
would only be true for a "empty" screen.
If your running conky or something like it thst might be the reason.
I fixed it by setting
own_window_type override in ~/.conkyrc
Then I merge yours and anrxc tips into this:
-- No border if maximized or the only window showing.
-- Set own_window_type override in .conkyrc or it will be counted as a client
for s = 1, screen.count() do screen[s]:add_signal("arrange", function ()
local clients = awful.client.visible(s)
for _, c in pairs(clients) do
if c.maximized_horizontal and c.maximized_vertical then
c.border_width = 0
elseif #clients == 1 then
c.border_width = 0
else
c.border_width = beautiful.border_width
end
end
end)
endSo thanks to both of you for giving me the motivation to finally do it ![]()
A tiling window manager simply manages your windows, not just letting you have em
:: Configs etc @GitHub
Offline
I was cutting a few corners there, yeah, just to get you going. Maximized means only it is visible, but then what is the difference when you only have one normal client, or a fullscreen client... why loose those pixels. A proper solution counts in things like a floating client above a maximized client... (think dialog), and your conky too ![]()
You need to install an RTFM interface.
Offline
greyscale, thank you!
Now it works. But there is a problem with VLC and smplayer now
When I hit super+m:
awful.key({ modkey, }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c.maximized_vertical = not c.maximized_vertical
end)VLC maximizes but there are some pixels on a right and bottom...
When does "arrange" signal come?
Offline
Are you sure you are ignoring size hints? Read the FAQ on awesome wiki, it will do you good. Signals page should have an answer to your last question.
You need to install an RTFM interface.
Offline
anrxc, there is no answer about "arrange" here https://awesome.naquadah.org/wiki/Signals ![]()
"size_hints_honor = false" helps
Thank you very much!
Offline
gray85:
Your right about that.
Haven't checked the source but "arrange" is emitted when changing tag, adding and removing clients (at least) so
it seems to be done when awesome "arranges" the clients on screen or how to say ![]()
A tiling window manager simply manages your windows, not just letting you have em
:: Configs etc @GitHub
Offline