awesomerc/slots/init.lua

76 lines
2.1 KiB
Lua
Raw Normal View History

2021-05-25 17:37:29 +02:00
local abutton = require 'awful.button'
local atitlebar = require 'awful.titlebar'
2021-06-28 19:05:22 +02:00
local beautiful = require 'beautiful'
2021-05-25 17:37:29 +02:00
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)
2021-06-28 19:05:22 +02:00
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()
2021-05-25 17:37:29 +02:00
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