81 lines
2.3 KiB
Lua
81 lines
2.3 KiB
Lua
local abutton = require 'awful.button'
|
|
local atag = require 'awful.tag'
|
|
local atitlebar = require 'awful.titlebar'
|
|
local lalign = require 'wibox.layout.align'
|
|
local lfixed = require 'wibox.layout.fixed'
|
|
local lflex = require 'wibox.layout.flex'
|
|
local naughty = require 'naughty'
|
|
|
|
-- You can require the configuration module to get access to other
|
|
-- configurations.
|
|
-- local configuration = require 'rc.configuration'
|
|
-- This would result in a depency loop as this file is part of the
|
|
-- configuration module.
|
|
--
|
|
-- If you need to access a configuration from the rc.configuration module,
|
|
-- you should add a direct require to the submodule here:
|
|
local configuration = {
|
|
tag_layouts = require 'rc.configuration.tag_layouts'
|
|
}
|
|
|
|
local slots = {}
|
|
|
|
function slots.create_tags (screen)
|
|
atag(
|
|
{ '1', '2', '3', '4', '5', '6', '7', '8', '9' },
|
|
screen,
|
|
configuration.tag_layouts)
|
|
end
|
|
|
|
function slots.build_desktop_decoration (screen)
|
|
local desktop_bar = require 'rc.ui.desktop_decoration.bar'
|
|
|
|
desktop_bar(screen)
|
|
end
|
|
|
|
function slots.build_client_titlebars (client)
|
|
-- Mouse buttons bindings for the titlebar
|
|
local buttons = {
|
|
abutton({}, 1,
|
|
function ()
|
|
client:activate { context = 'titlebar', action = 'mouse_move' }
|
|
end),
|
|
abutton({}, 3,
|
|
function ()
|
|
client:activate { context = 'titlebar', action = 'mouse_resize' }
|
|
end),
|
|
}
|
|
|
|
-- Titlebar UI
|
|
atitlebar(client).widget = {
|
|
{ -- Left
|
|
atitlebar.widget.iconwidget(client),
|
|
buttons = buttons,
|
|
layout = lfixed.horizontal
|
|
},
|
|
{ -- Middle
|
|
{ -- Title
|
|
align = 'center',
|
|
widget = atitlebar.widget.titlewidget(client)
|
|
},
|
|
buttons = buttons,
|
|
layout = lflex.horizontal
|
|
},
|
|
{ -- Right
|
|
atitlebar.widget.floatingbutton(client),
|
|
atitlebar.widget.maximizedbutton(client),
|
|
atitlebar.widget.stickybutton(client),
|
|
atitlebar.widget.ontopbutton(client),
|
|
atitlebar.widget.closebutton(client),
|
|
layout = lfixed.horizontal()
|
|
},
|
|
layout = lalign.horizontal
|
|
}
|
|
end
|
|
|
|
function slots.naughty_display (notification)
|
|
naughty.layout.box { notification = notification }
|
|
end
|
|
|
|
return slots
|