Skip to content

Instantly share code, notes, and snippets.

@Elv13
Created October 28, 2021 01:50
Show Gist options
  • Save Elv13/f202bb564fa281fbd4288cf9998e7e51 to your computer and use it in GitHub Desktop.
Save Elv13/f202bb564fa281fbd4288cf9998e7e51 to your computer and use it in GitHub Desktop.
client.connect_signal("request::titlebars", function(c)
local window_title = {
align = "center",
widget = b.titlewidget(c)
}
local move_window = click(left_click, function() c:emit_signal("request::activate", "titlebar", {raise = true}) awful.mouse.client.move(c) end )
titlebar_color = nil
if(client.focus == true) then
titlebar_color = beautiful.color01
else
titlebar_color = beautiful.color_dark
end
local margin_widget = wibox.container.margin()
margin_widget.bottom = 1
margin_widget.color = titlebar_color
--BEGIN Compatible with v4.3
client.connect_signal("focus", function(c2)
if c == c2 then
margin_widget.color = beautiful.color01
end
end)
client.connect_signal("unfocus", function(c2)
if c == c2 then
margin_widget.color = beautiful.color_dark
end
end)
--END compat with v4.3
-- GIT MASTER VERSION
--c:connect_signal("property::active", function()
-- margin_widget.color = c.active and beautiful.color01 or beautiful.color_dark
--end)
margin_widget.widget = wibox.widget {
--------------------
-- Left --
--------------------
{ b.ontopbutton(c),
layout = wibox.layout.fixed.horizontal
},
--------------------
-- Middle --
--------------------
{ window_title,
buttons = move_window,
layout = wibox.layout.flex.horizontal
},
--------------------
-- Right --
--------------------
{ b.minimizebutton(c), b.floatingbutton(c), b.closebutton(c),
layout = wibox.layout.fixed.horizontal
},
layout = wibox.layout.align.horizontal
},
local tb = awful.titlebar(c, {size=beautiful.titlebar_size})
tb.widget = margin_widget
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment