awesome: no gap and border on maximized windows
This commit is contained in:
@@ -484,7 +484,8 @@ awful.rules.rules = {
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
|
||||
size_hints_honor = false,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -536,6 +537,19 @@ awful.rules.rules = {
|
||||
-- }}}
|
||||
|
||||
-- {{{ Signals
|
||||
|
||||
local function set_border_width(c)
|
||||
local t = awful.screen.focused().selected_tag
|
||||
if #t:clients() == 1 or t.layout.name == 'max' then
|
||||
c = c or client.focus
|
||||
c.border_width = 0
|
||||
else
|
||||
for _, cl in ipairs(t:clients()) do
|
||||
cl.border_width = beautiful.border_width
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.connect_signal("manage", function(c)
|
||||
-- Set the windows at the slave,
|
||||
@@ -548,6 +562,7 @@ client.connect_signal("manage", function(c)
|
||||
-- Prevent clients from being unreachable after screen count changes.
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
set_border_width(c)
|
||||
end)
|
||||
|
||||
-- Enable sloppy focus, so that focus follows mouse.
|
||||
@@ -555,6 +570,23 @@ client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", { raise = false })
|
||||
end)
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
-- local function set_border(c)
|
||||
-- local s = awful.screen.focused()
|
||||
-- if c.maximized
|
||||
-- or (#s.tiled_clients == 1 and not c.floating)
|
||||
-- or (s.selected_tag and s.selected_tag.layout.name == 'max')
|
||||
-- then
|
||||
-- c.border_width = 0
|
||||
-- else
|
||||
-- c.border_width = beautiful.border_width
|
||||
-- end
|
||||
-- end
|
||||
|
||||
client.connect_signal("focus", function(c)
|
||||
c.border_color = beautiful.border_focus
|
||||
set_border_width(c)
|
||||
end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal; end)
|
||||
tag.connect_signal("property::layout", function() set_border_width(nil) end)
|
||||
|
||||
-- }}}
|
||||
|
||||
@@ -22,6 +22,7 @@ theme.fg_urgent = theme.bg_focus
|
||||
theme.fg_minimize = theme.fg_normal
|
||||
theme.taglist_fg_empty = "#454f54" -- hsl(200 10% 30%)
|
||||
|
||||
theme.gap_single_client = false
|
||||
theme.useless_gap = dpi(1)
|
||||
theme.border_width = dpi(2)
|
||||
theme.border_normal = "#73848c" -- hsl(200 10% 50%)
|
||||
|
||||
@@ -22,6 +22,7 @@ theme.fg_urgent = "#70675c" -- hsl(34 10% 40%)
|
||||
theme.fg_minimize = "#70675c" -- hsl(34 10% 40%)
|
||||
theme.taglist_fg_empty = theme.fg_minimize
|
||||
|
||||
theme.gap_single_client = false
|
||||
theme.useless_gap = dpi(1)
|
||||
theme.border_width = dpi(2)
|
||||
theme.border_normal = theme.bg_minimize
|
||||
|
||||
Reference in New Issue
Block a user