You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
5.2 KiB
148 lines
5.2 KiB
local awmtk2 = require("awmtk2")
|
|
local gears = require("gears")
|
|
local wibox = require("wibox")
|
|
local awful = require("awful")
|
|
local beautiful = require("beautiful")
|
|
|
|
-- {{{ Global widgets
|
|
local runmenu = require("widgets.dismal")({})
|
|
|
|
-- }}}
|
|
|
|
-- {{{ Titlebars
|
|
local style = awmtk2.create_style("titlebar",awmtk2.default,{})
|
|
style.titlebar_top = awmtk2.create_delta("titlebar_top", {},
|
|
(beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar)
|
|
style.titlebar_left = awmtk2.create_delta("titlebar_left", {},
|
|
(beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar)
|
|
style.titlebar_right = awmtk2.create_delta("titlebar_right", {},
|
|
(beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar)
|
|
style.titlebar_bottom = awmtk2.create_delta("titlebar_bottom", {},
|
|
(beautiful.widgets and beautiful.widgets.titlebar) or {}, style.titlebar)
|
|
local templates = awmtk2.create_template_lib("titlebar",awmtk2.templates,{})
|
|
local t = awmtk2.build_templates(templates,style)
|
|
table.insert(awful.rules.rules,
|
|
{ rule_any = {type = { "normal", "dialog" }
|
|
}, properties = { titlebars_enabled = true }
|
|
}
|
|
)
|
|
client.connect_signal("request::titlebars",function(c)
|
|
local buttons = gears.table.join(
|
|
awful.button({}, 1, function()
|
|
c:emit_signal("request::activate","titlebar",{raise=true})
|
|
awful.mouse.client.move(c)
|
|
end),
|
|
awful.button({}, 3, function()
|
|
c:emit_signal("request::activate","titlebar",{raise=true})
|
|
awful.mouse.client.resize(c)
|
|
end)
|
|
)
|
|
|
|
awful.titlebar(c,{
|
|
size = style.titlebar_top.size or 16,
|
|
bg_normal = style.titlebar_top.bg_normal,
|
|
bg_focus = style.titlebar_top.bg_focus,
|
|
bgimage_normal = style.titlebar_top.bgimage_normal,
|
|
bgimage_focus = style.titlebar_top.bgimage_focus,
|
|
fg_normal = style.titlebar_top.fg_normal,
|
|
fg_focus = style.titlebar_top.fg_focus,
|
|
font = style.titlebar_top.font
|
|
}):setup(t.titlebar({
|
|
{ -- Left
|
|
awful.titlebar.widget.iconwidget(c),
|
|
buttons = buttons,
|
|
layout = wibox.layout.fixed.horizontal
|
|
},
|
|
{ -- Middle
|
|
{ -- Title
|
|
align = "center",
|
|
widget = awful.titlebar.widget.titlewidget(c)
|
|
},
|
|
buttons = buttons,
|
|
layout = wibox.layout.flex.horizontal
|
|
},
|
|
{ -- Right
|
|
awful.titlebar.widget.floatingbutton (c),
|
|
awful.titlebar.widget.maximizedbutton(c),
|
|
awful.titlebar.widget.stickybutton (c),
|
|
awful.titlebar.widget.ontopbutton (c),
|
|
awful.titlebar.widget.closebutton (c),
|
|
layout = wibox.layout.fixed.horizontal()
|
|
},
|
|
layout = wibox.layout.align.horizontal
|
|
}))
|
|
awful.titlebar(c,{
|
|
size = style.titlebar_right.size or 0,
|
|
position = "right",
|
|
bg_normal = style.titlebar_right.bg_normal,
|
|
bg_focus = style.titlebar_right.bg_focus,
|
|
bgimage_normal = style.titlebar_right.bgimage_normal,
|
|
bgimage_focus = style.titlebar_right.bgimage_focus,
|
|
fg_normal = style.titlebar_right.fg_normal,
|
|
fg_focus = style.titlebar_right.fg_focus,
|
|
font = style.titlebar_right.font
|
|
}):setup(t.titlebar({widget = wibox.container.background}))
|
|
awful.titlebar(c,{
|
|
size = style.titlebar_bottom.size or 0,
|
|
position = "bottom",
|
|
bg_normal = style.titlebar_bottom.bg_normal,
|
|
bg_focus = style.titlebar_bottom.bg_focus,
|
|
bgimage_normal = style.titlebar_bottom.bgimage_normal,
|
|
bgimage_focus = style.titlebar_bottom.bgimage_focus,
|
|
fg_normal = style.titlebar_bottom.fg_normal,
|
|
fg_focus = style.titlebar_bottom.fg_focus,
|
|
font = style.titlebar_bottom.font
|
|
}):setup(t.titlebar({widget = wibox.container.background}))
|
|
awful.titlebar(c,{
|
|
size = style.titlebar_left.size or 0,
|
|
position = "left",
|
|
bg_normal = style.titlebar_left.bg_normal,
|
|
bg_focus = style.titlebar_left.bg_focus,
|
|
bgimage_normal = style.titlebar_left.bgimage_normal,
|
|
bgimage_focus = style.titlebar_left.bgimage_focus,
|
|
fg_normal = style.titlebar_left.fg_normal,
|
|
fg_focus = style.titlebar_left.fg_focus,
|
|
font = style.titlebar_left.font
|
|
}):setup(t.titlebar({widget = wibox.container.background}))
|
|
end)
|
|
--}}}
|
|
|
|
--{{{ Screen
|
|
awful.screen.connect_for_each_screen(function(s)
|
|
-- Top bar
|
|
s.topbar = awful.wibar({
|
|
position = "top",
|
|
screen = s,
|
|
visible = false
|
|
})
|
|
s.topbar:setup {
|
|
layout = wibox.layout.flex.horizontal
|
|
}
|
|
-- Bottom bar
|
|
s.bottombar = awful.wibar({
|
|
position = "bottom",
|
|
screen = s,
|
|
visible = false
|
|
})
|
|
s.bottombar:setup {
|
|
layout = wibox.layout.flex.horizontal
|
|
}
|
|
-- Left bar
|
|
s.leftbar = awful.wibar({
|
|
position = "left",
|
|
screen = s,
|
|
visible = false
|
|
})
|
|
s.leftbar:setup {
|
|
layout = wibox.layout.flex.horizontal
|
|
}
|
|
-- Right bar
|
|
s.rightbar = awful.wibar({
|
|
position = "right",
|
|
screen = s,
|
|
visible = false
|
|
})
|
|
s.rightbar:setup {
|
|
layout = wibox.layout.flex.horizontal
|
|
}
|
|
end)
|