lazy push before updates
This commit is contained in:
30
deco/screens.lua
Normal file
30
deco/screens.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
local awful = require("awful")
|
||||
|
||||
local taglist = require("deco.taglist")
|
||||
local tasklist = require("deco.tasklist")
|
||||
local layoutbox = require("deco.layoutbox")
|
||||
local wallpaper = require("deco.wallpaper")
|
||||
|
||||
local bottom_statusbar = require("statusbar.bottom.statusbar")
|
||||
local top_statusbar = require("statusbar.top.statusbar")
|
||||
|
||||
local _M = {}
|
||||
|
||||
function _M.setup()
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
wallpaper(s)
|
||||
|
||||
s.layoutbox = layoutbox(s)
|
||||
s.taglist = taglist(s)
|
||||
s.tasklist = tasklist(s)
|
||||
|
||||
top_statusbar(s)
|
||||
bottom_statusbar(s)
|
||||
end)
|
||||
end
|
||||
|
||||
return setmetatable(_M, {
|
||||
__call = function()
|
||||
return _M.setup()
|
||||
end,
|
||||
})
|
||||
@@ -1,41 +0,0 @@
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
|
||||
local wallpaper = require("deco.wallpaper")
|
||||
local taglist = require("deco.taglist")
|
||||
local tasklist = require("deco.tasklist")
|
||||
local layoutbox = require("deco.layoutbox")
|
||||
|
||||
return function(s)
|
||||
wallpaper(s)
|
||||
|
||||
-- Create a promptbox for each screen
|
||||
s.promptbox = awful.widget.prompt()
|
||||
|
||||
s.layoutbox = layoutbox(s)
|
||||
|
||||
s.taglist = taglist(s)
|
||||
|
||||
s.tasklist = tasklist(s)
|
||||
|
||||
-- Create the wibox
|
||||
s.wibox = awful.wibar({ position = "bottom", screen = s })
|
||||
|
||||
-- Add widgets to the wibox
|
||||
s.wibox:setup({
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
s.taglist,
|
||||
s.promptbox,
|
||||
},
|
||||
s.tasklist, -- Middle widget
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
wibox.widget.systray(),
|
||||
wibox.widget.textclock(),
|
||||
s.layoutbox,
|
||||
},
|
||||
})
|
||||
end
|
||||
@@ -1,5 +1,8 @@
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local lain = require("lain")
|
||||
|
||||
local _M = {}
|
||||
|
||||
@@ -27,9 +30,86 @@ function _M.get(s)
|
||||
end)
|
||||
)
|
||||
|
||||
return awful.widget.taglist({
|
||||
local separators = lain.util.separators
|
||||
|
||||
local arrl_dl = separators.arrow_right(beautiful.taglist_separator, "alpha")
|
||||
local arrl_ld = separators.arrow_right("alpha", beautiful.taglist_separator)
|
||||
|
||||
return awful.widget.taglist({
|
||||
screen = s,
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
style = {
|
||||
shape = gears.shape.powerline,
|
||||
},
|
||||
layout = {
|
||||
spacing = 10,
|
||||
spacing_widget = arrl_ld,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
arrl_dl,
|
||||
{
|
||||
{
|
||||
id = "icon_role",
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
margins = 2,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
{
|
||||
{
|
||||
id = "index_role",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
margins = 3,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
bg = beautiful.taglist_bg_tag,
|
||||
shape = gears.shape.circle,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
{
|
||||
{
|
||||
id = "icon_role",
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
margins = 2,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
id = "text_role",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
right = 10,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
id = "background_role",
|
||||
widget = wibox.container.background,
|
||||
-- Add support for hover colors and an index label
|
||||
create_callback = function(self, c3, index, objects) --luacheck: no unused args
|
||||
self:get_children_by_id("index_role")[1].markup = "<b> " .. index .. " </b>"
|
||||
self:connect_signal("mouse::enter", function()
|
||||
if self.bg ~= "#33cc3355" then
|
||||
self.backup = self.bg
|
||||
self.has_backup = true
|
||||
end
|
||||
self.bg = "#33cc3355"
|
||||
end)
|
||||
self:connect_signal("mouse::leave", function()
|
||||
if self.has_backup then
|
||||
self.bg = self.backup
|
||||
end
|
||||
end)
|
||||
end,
|
||||
update_callback = function(self, c3, index, objects) --luacheck: no unused args
|
||||
self:get_children_by_id("index_role")[1].markup = "<b> " .. index .. " </b>"
|
||||
end,
|
||||
},
|
||||
buttons = taglist_buttons,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -2,8 +2,7 @@ local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
||||
client.connect_signal("request::titlebars", function(c)
|
||||
return function(c)
|
||||
-- buttons for the titlebar
|
||||
local buttons = gears.table.join(
|
||||
awful.button({}, 1, function()
|
||||
@@ -31,13 +30,11 @@ client.connect_signal("request::titlebars", function(c)
|
||||
layout = wibox.layout.flex.horizontal,
|
||||
},
|
||||
{ -- Right
|
||||
awful.titlebar.widget.floatingbutton(c),
|
||||
awful.titlebar.widget.minimizebutton(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,
|
||||
})
|
||||
end)
|
||||
end
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
|
||||
local _W = {}
|
||||
|
||||
function _W.set_wallpaper(s)
|
||||
local wallpaper = require("theme.wallpaper")
|
||||
local wallpaper = beautiful.wallpaper
|
||||
|
||||
if type(wallpaper) == "function" then
|
||||
wallpaper = wallpaper(s)
|
||||
|
||||
Reference in New Issue
Block a user