Reno is the second iteration of the AWMTK-powered AwesomeWM config.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

70 lines
3.1 KiB

-- This file is part of Reno desktop.
--
-- Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
--
-- Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>.
-- Base for widgets
local awmtk2 = require("awmtk2")
local wibox = require("wibox")
local gears = require("gears")
local awful = require("awful")
local beautiful = require("beautiful")
return function(args)
local style = awmtk2.create_style("taglist",
awmtk2.generic.oneline_widget,args.style,args.vertical)
local templates = awmtk2.create_template_lib("taglist",awmtk2.templates,args.templates)
local t = awmtk2.build_templates(templates,style,args.vertical)
local widget = wibox.widget(t.container(awful.widget.taglist({
screen = args.screen,
filter = awful.widget.taglist.filter.all,
style = {
shape = style.button.shape
},
layout = {
spacing = style.base.spacing,
spacing_widget = style.base.spacing_widget,
layout = style.base.layout or wibox.layout.fixed.horizontal
},
widget_template = t.button(t.article({
icon_id = "icon_role",
title_id = "text_role"
}),{
id = "background",
create_callback = function(self, tag, index, tags)
self:connect_signal("button::press",function(self,x,y,b)
if b == 1 then
awful.tag.viewmore({tag})
elseif b == 3 then
awful.tag.viewtoggle(tag)
elseif b == 4 then
awful.tag.viewnext()
elseif b == 5 then
awful.tag.viewprev()
end
end)
local bg = self:get_children_by_id("background")[1]
if tag.selected then
bg.bgimage = style.button.bgimage_focus
bg.bg = style.button.bg_focus
else
bg.bgimage = style.button.bgimage_normal
bg.bg = style.button.bg_normal
end
end,
update_callback = function(self, tag, index, tags)
local bg = self:get_children_by_id("background")[1]
if tag.selected then
bg.bgimage = style.button.bgimage_focus
bg.bg = style.button.bg_focus
else
bg.bgimage = style.button.bgimage_normal
bg.bg = style.button.bg_normal
end
end
})
})))
return widget
end