144 lines
4.4 KiB
Lua
144 lines
4.4 KiB
Lua
local beautiful = require("beautiful")
|
|
local awful = require("awful")
|
|
local gears = require("gears")
|
|
local wibox = require("wibox")
|
|
-- {{{ Wibar
|
|
|
|
-- Create a wibox for each screen and add it
|
|
|
|
local function set_wallpaper(s)
|
|
-- Wallpaper
|
|
if beautiful.wallpaper then
|
|
local wallpaper = beautiful.wallpaper
|
|
-- If wallpaper is a function, call it with the screen
|
|
if type(wallpaper) == "function" then
|
|
wallpaper = wallpaper(s)
|
|
end
|
|
gears.wallpaper.maximized(wallpaper, s, true)
|
|
end
|
|
end
|
|
|
|
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
|
screen.connect_signal("property::geometry", set_wallpaper)
|
|
|
|
-- {{{ Non-widget modules
|
|
-- The following modules are not exactly widgets, however they are part of the ui.
|
|
|
|
-- Load the keybindings list
|
|
require("core.widgets.hotkeys_popup")
|
|
|
|
-- Load the menubar
|
|
require("core.widgets.menubar")
|
|
-- }}}
|
|
|
|
awful.screen.connect_for_each_screen(function(s)
|
|
-- Wallpaper
|
|
set_wallpaper(s)
|
|
|
|
-- Each screen has its own tag table.
|
|
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
|
|
|
|
-- Create a promptbox for each screen
|
|
s.mypromptbox = require("core.widgets.prompt")()
|
|
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
|
|
-- Create the taglist
|
|
s.mytaglist = require("core.widgets.taglist")(s)
|
|
-- We need one layoutbox per screen.
|
|
s.mylayoutbox = require("core.widgets.layout_box")(s)
|
|
-- Create a tasklist widget
|
|
s.mytasklist = require("core.widgets.tasklist")(s)
|
|
-- Create the wibox
|
|
s.mywibox = awful.wibar({
|
|
position = "top",
|
|
screen = s,
|
|
bg = beautiful.topbar_bg,
|
|
})
|
|
-- Add screen lock
|
|
require("widgets.lock")({screen = s, obscure = true})
|
|
require("widgets.unitybar")(s,{
|
|
top_widgets = {
|
|
require("widgets.polytasklist")({
|
|
vertical = true,
|
|
stretch = false,
|
|
--constraint = 180,
|
|
names = false,
|
|
margins = 5
|
|
})(s),
|
|
},
|
|
bottom_widgets = {
|
|
require("widgets.polylauncher")({vertical = true})
|
|
}
|
|
})
|
|
-- Add widgets to the wibox
|
|
s.mywibox:setup {
|
|
layout = wibox.layout.align.horizontal,
|
|
{ -- Left widgets
|
|
layout = wibox.layout.fixed.horizontal,
|
|
{
|
|
{
|
|
require("core.widgets.menu_launcher"),
|
|
widget = wibox.container.place,
|
|
halign = "center"
|
|
},
|
|
bg = "#26262633",
|
|
widget = wibox.container.background,
|
|
forced_width = require("beautiful.xresources").apply_dpi(61),
|
|
},
|
|
--require("widgets.polylauncher")({vertical = false}),
|
|
--s.mytaglist,
|
|
s.mypromptbox,
|
|
spacing = 3
|
|
},
|
|
-- Middle widget
|
|
{
|
|
--[[require("widgets.polytasklist")({
|
|
vertical = false,
|
|
stretch = false,
|
|
constraint = 180,
|
|
names = true,
|
|
margins = 5
|
|
})(s),]]
|
|
layout = wibox.layout.fixed.horizontal
|
|
},
|
|
{ -- Right widgets
|
|
layout = wibox.layout.fixed.horizontal,
|
|
awful.widget.keyboardlayout(),
|
|
require("widgets.wallpapers")({
|
|
screen = s,
|
|
path = os.getenv("HOME").."/Pictures/Wallpapers/",
|
|
style = {
|
|
icon_bg_normal = beautiful.topbar_bg
|
|
}
|
|
}),
|
|
require("widgets.mailbox")({
|
|
screen = s,
|
|
style = {
|
|
rounding = 1,
|
|
icon_bg_normal = beautiful.topbar_bg
|
|
}
|
|
}),
|
|
--wibox.widget.systray(),
|
|
require("widgets.volume")({
|
|
style = {
|
|
icon_bg_normal = beautiful.topbar_bg
|
|
}
|
|
}),
|
|
require("widgets.battery")({
|
|
percentage = true,
|
|
style = {
|
|
icon_bg_normal = beautiful.topbar_bg
|
|
}
|
|
}),
|
|
wibox.widget.textclock(),
|
|
require("widgets.username")({
|
|
style = {
|
|
icon_bg_normal = beautiful.topbar_bg
|
|
}
|
|
}),
|
|
s.mylayoutbox,
|
|
spacing = 4
|
|
},
|
|
}
|
|
end)
|
|
-- }}}
|