awesomerc/slots/init.lua

76 lines
2.1 KiB
Lua

local abutton = require 'awful.button'
local atitlebar = require 'awful.titlebar'
local beautiful = require 'beautiful'
local lalign = require 'wibox.layout.align'
local lfixed = require 'wibox.layout.fixed'
local lflex = require 'wibox.layout.flex'
local naughty = require 'naughty'
local slots = {}
function slots.create_tags (screen)
local atag = require 'awful.tag'
local home_layout = require 'MyTagLayout.home_layout'
local first_tag = atag.add('home', {
screen = screen,
icon = beautiful.icon_hometag,
layout = home_layout,
master_width_factor = beautiful.hometag_master_width_factor
})
first_tag:view_only()
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