mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2026-03-23 05:55:12 +00:00
#45 fix
This commit is contained in:
parent
f926898ac1
commit
80a8d512d7
|
|
@ -2,9 +2,9 @@ local awful = require("awful")
|
|||
local beautiful = require("beautiful")
|
||||
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
-- signal function to execute when a new client appears.
|
||||
client.connect_signal("manage", function (c, startup)
|
||||
-- Enable sloppy focus
|
||||
-- enable sloppy focus
|
||||
c:connect_signal("mouse::enter", function(c)
|
||||
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
|
||||
and awful.client.focus.filter(c) then
|
||||
|
|
@ -17,16 +17,53 @@ client.connect_signal("manage", function (c, startup)
|
|||
awful.placement.no_overlap(c)
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
|
||||
local titlebars_enabled = false
|
||||
if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
|
||||
-- buttons for the titlebar
|
||||
local buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({ }, 3, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
)
|
||||
|
||||
-- widgets that are aligned to the right
|
||||
local right_layout = wibox.layout.fixed.horizontal()
|
||||
right_layout:add(awful.titlebar.widget.floatingbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.maximizedbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.stickybutton(c))
|
||||
right_layout:add(awful.titlebar.widget.ontopbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.closebutton(c))
|
||||
|
||||
-- the title goes in the middle
|
||||
local middle_layout = wibox.layout.flex.horizontal()
|
||||
local title = awful.titlebar.widget.titlewidget(c)
|
||||
title:set_align("center")
|
||||
middle_layout:add(title)
|
||||
middle_layout:buttons(buttons)
|
||||
|
||||
-- now bring it all together
|
||||
local layout = wibox.layout.align.horizontal()
|
||||
layout:set_right(right_layout)
|
||||
layout:set_middle(middle_layout)
|
||||
|
||||
awful.titlebar(c,{size=16}):set_widget(layout)
|
||||
end
|
||||
end)
|
||||
|
||||
-- No border for maximized clients
|
||||
client.connect_signal("focus",
|
||||
function(c)
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
c.border_color = beautiful.border_normal
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
c.border_color = beautiful.border_focus
|
||||
end
|
||||
end)
|
||||
|
|
|
|||
Loading…
Reference in a new issue