Add and document more beautiful values for [tag,task]lists
This commit is contained in:
parent
162483dade
commit
76ea448b2d
|
@ -16,4 +16,22 @@ between the taglist and the tags. This module aim to fix this.
|
||||||
|
|
||||||
Plus, it inherit Radical style and layouts engines for both item and style, so
|
Plus, it inherit Radical style and layouts engines for both item and style, so
|
||||||
this module could technically be used as a box menu or something like that
|
this module could technically be used as a box menu or something like that
|
||||||
without modifications.
|
without modifications.
|
||||||
|
|
||||||
|
### Beautiful options
|
||||||
|
|
||||||
|
taglist_bg_selected
|
||||||
|
taglist_fg_selected
|
||||||
|
|
||||||
|
taglist_bg
|
||||||
|
taglist_fg
|
||||||
|
taglist_bg_hover
|
||||||
|
taglist_fg_hover
|
||||||
|
taglist_bg_used
|
||||||
|
taglist_fg_used
|
||||||
|
taglist_bg_urgent
|
||||||
|
taglist_fg_urgent
|
||||||
|
taglist_bg_cloned
|
||||||
|
taglist_fg_cloned
|
||||||
|
taglist_bg_changed
|
||||||
|
taglist_fg_changed
|
|
@ -168,7 +168,7 @@ local function init()
|
||||||
capi.tag.connect_signal("property::icon", function(t)
|
capi.tag.connect_signal("property::icon", function(t)
|
||||||
local item = cache[t]
|
local item = cache[t]
|
||||||
if item then
|
if item then
|
||||||
item.icon = tag.geticon(t)
|
item.icon = tag.geticon(t) or beautiful.taglist_default_icon
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
is_init = true
|
is_init = true
|
||||||
|
@ -180,22 +180,17 @@ local function new(s)
|
||||||
item_style = radical.item.style.arrow_prefix,
|
item_style = radical.item.style.arrow_prefix,
|
||||||
select_on = radical.base.event.NEVER,
|
select_on = radical.base.event.NEVER,
|
||||||
fg = beautiful.tasglist_fg or beautiful.fg_normal,
|
fg = beautiful.tasglist_fg or beautiful.fg_normal,
|
||||||
|
bg = beautiful.tasglist_bg or beautiful.bg_normal,
|
||||||
bg_focus = beautiful.taglist_bg_selected,
|
bg_focus = beautiful.taglist_bg_selected,
|
||||||
fg_focus = beautiful.taglist_fg_selected,
|
fg_focus = beautiful.taglist_fg_selected,
|
||||||
-- fkeys_prefix = true,
|
-- fkeys_prefix = true,
|
||||||
}
|
}
|
||||||
for k,v in ipairs {"hover","used","urgent","cloned","changed"} do
|
for k,v in ipairs {"hover","used","urgent","cloned","changed"} do
|
||||||
args["bg_"..v] = beautiful["taglist_bg_"..v]
|
args["bg_"..v] = beautiful["taglist_bg_"..v]
|
||||||
|
args["fg_"..v] = beautiful["taglist_fg_"..v]
|
||||||
end
|
end
|
||||||
|
|
||||||
instances[s] = radical.bar(args)-- {
|
instances[s] = radical.bar(args)
|
||||||
-- bg_hover = beautiful.menu_bg_focus,
|
|
||||||
-- bg_used = beautiful.taglist_bg_image_used,
|
|
||||||
-- bg_urgent = beautiful.taglist_bg_image_urgent,
|
|
||||||
-- bg_changed = beautiful.taglist_bg_image_changed,
|
|
||||||
-- bg_cloned = beautiful.taglist_bg_image_cloned,
|
|
||||||
-- fg_cloned = "#00bb00",
|
|
||||||
-- }
|
|
||||||
|
|
||||||
|
|
||||||
-- Load the innitial set of tags
|
-- Load the innitial set of tags
|
||||||
|
@ -204,9 +199,7 @@ local function new(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Per screen signals
|
-- Per screen signals
|
||||||
-- tag.attached_connect_signal(s, "property::selected", tag_added)
|
-- tag.attached_connect_signal(screen, "property::hide", ut)!
|
||||||
-- tag.attached_connect_signal(screen, "property::hide", ut)
|
|
||||||
-- tag.attached_connect_signal(s, "property::index", tag_added)
|
|
||||||
|
|
||||||
instances[s]:connect_signal("button::press",function(m,item,button_id,mod)
|
instances[s]:connect_signal("button::press",function(m,item,button_id,mod)
|
||||||
if module.buttons and module.buttons[button_id] then
|
if module.buttons and module.buttons[button_id] then
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
### Beautiful options
|
### Beautiful options
|
||||||
|
|
||||||
tasklist_icon_transformation | function(image) |
|
tasklist_bg_hover
|
||||||
|
tasklist_fg_hover
|
||||||
|
tasklist_underlay_bg_hover
|
||||||
|
tasklist_bg_urgent
|
||||||
|
tasklist_fg_urgent
|
||||||
|
tasklist_underlay_bg_urgent
|
||||||
|
tasklist_bg_minimized
|
||||||
|
tasklist_fg_minimized
|
||||||
|
tasklist_underlay_bg_minimized
|
||||||
|
tasklist_bg_focus
|
||||||
|
tasklist_fg_focus
|
||||||
|
tasklist_underlay_bg_focus
|
||||||
|
tasklist_fg
|
||||||
|
tasklist_bg
|
||||||
|
tasklist_underlay_style
|
||||||
|
tasklist_icon_transformation
|
||||||
|
tasklist_default_icon
|
|
@ -14,8 +14,11 @@ local beautiful = require( "beautiful" )
|
||||||
local client = require( "awful.client" )
|
local client = require( "awful.client" )
|
||||||
local wibox = require( "wibox" )
|
local wibox = require( "wibox" )
|
||||||
local client_menu = require("radical.impl.tasklist.client_menu")
|
local client_menu = require("radical.impl.tasklist.client_menu")
|
||||||
|
local theme = require( "radical.theme")
|
||||||
|
|
||||||
local sticky,urgent,instances,module = {},{},{},{}
|
local sticky,urgent,instances,module = {},{},{},{}
|
||||||
|
local MINIMIZED = 101
|
||||||
|
theme.register_color(MINIMIZED , "minimized" , "tasklist_minimized" , true )
|
||||||
|
|
||||||
-- Default button implementation
|
-- Default button implementation
|
||||||
module.buttons = {
|
module.buttons = {
|
||||||
|
@ -71,6 +74,14 @@ local function urgent_callback(c)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function minimize_callback(c)
|
||||||
|
local item = instances[c.screen].cache[c]
|
||||||
|
if item then
|
||||||
|
local val = c.minimized
|
||||||
|
item.state[MINIMIZED] = val or nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function unmanage_callback(c)
|
local function unmanage_callback(c)
|
||||||
sticky[c] = nil
|
sticky[c] = nil
|
||||||
urgent[c] = nil
|
urgent[c] = nil
|
||||||
|
@ -105,7 +116,7 @@ local function reload_content(c,b,a)
|
||||||
local item = cache[c]
|
local item = cache[c]
|
||||||
if item then
|
if item then
|
||||||
item.text = c.name or "N/A"
|
item.text = c.name or "N/A"
|
||||||
item.icon = c.icon
|
item.icon = c.icon or beautiful.tasklist_default_icon
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -153,19 +164,24 @@ local function focus(c)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function new(screen)
|
local function new(screen)
|
||||||
local cache,menu = setmetatable({}, { __mode = 'k' }),radical.flexbar {
|
local args = {
|
||||||
select_on=radical.base.event.NEVER,
|
select_on=radical.base.event.NEVER,
|
||||||
fg = beautiful.fg_normal,
|
|
||||||
bg_focus = beautiful.taglist_bg_image_selected2,
|
|
||||||
bg_urgent = beautiful.taglist_bg_image_urgent2,
|
|
||||||
bg_hover = beautiful.menu_bg_focus,
|
|
||||||
disable_markup = true,
|
disable_markup = true,
|
||||||
underlay_style = radical.widgets.underlay.draw_arrow,
|
fg = beautiful.tasklist_fg or beautiful.fg_normal,
|
||||||
overlay = function(data,item,cd,w,h)
|
bg = beautiful.tasklist_bg or beautiful.fg_normal,
|
||||||
-- print("foo!")
|
underlay_style = beautiful.tasklist_underlay_style or radical.widgets.underlay.draw_arrow,
|
||||||
end,
|
|
||||||
icon_transformation = beautiful.tasklist_icon_transformation
|
icon_transformation = beautiful.tasklist_icon_transformation
|
||||||
}
|
}
|
||||||
|
for k,v in ipairs {"hover","urgent","minimized","focus"} do
|
||||||
|
args["bg_"..v] = beautiful["tasklist_bg_"..v]
|
||||||
|
args["fg_"..v] = beautiful["tasklist_fg_"..v]
|
||||||
|
args["underlay_bg_"..v] = beautiful["tasklist_underlay_bg_"..v]
|
||||||
|
end
|
||||||
|
local cache,menu = setmetatable({}, { __mode = 'k' }),radical.flexbar(args)
|
||||||
|
-- overlay = function(data,item,cd,w,h)
|
||||||
|
-- print("foo!")
|
||||||
|
-- end,
|
||||||
|
-- }
|
||||||
|
|
||||||
-- Clear the menu and repopulate it
|
-- Clear the menu and repopulate it
|
||||||
local function load_clients(t)
|
local function load_clients(t)
|
||||||
|
@ -206,28 +222,6 @@ local function new(screen)
|
||||||
|
|
||||||
load_clients(tag.selected(screen))
|
load_clients(tag.selected(screen))
|
||||||
|
|
||||||
-- Try to make awesome think radical.bar is a real widget
|
|
||||||
-- Use "menu._internal.layout" directly in :add to avoid
|
|
||||||
-- the proxy overhead, for now it doesn't event work on 3.5.2
|
|
||||||
-- rawset(menu,"fit",function(self,...)
|
|
||||||
-- return menu._internal.layout.fit(menu._internal.layout,...)
|
|
||||||
-- end)
|
|
||||||
-- rawset(menu,"draw",function(self,...)
|
|
||||||
-- return menu._internal.layout.draw(menu._internal.layout,...)
|
|
||||||
-- end)
|
|
||||||
-- rawset(menu,"add_signal",function(self,...)
|
|
||||||
-- return menu._internal.layout.add_signal(menu._internal.layout,...)
|
|
||||||
-- end)
|
|
||||||
-- rawset(menu,"disconnect_signal",function(a,...)
|
|
||||||
-- return menu._internal.layout.disconnect_signal(menu._internal.layout,...)
|
|
||||||
-- end)
|
|
||||||
-- rawset(menu,"connect_signal",function(a,...)
|
|
||||||
-- return menu._internal.layout.disconnect_signal(menu._internal.layout,...)
|
|
||||||
-- end)
|
|
||||||
-- rawset(menu,"emit_signal",function(a,...)
|
|
||||||
-- return menu._internal.layout.emit_signal(menu._internal.layout,...)
|
|
||||||
-- end)
|
|
||||||
|
|
||||||
menu:connect_signal("button::press",function(menu,item,button_id,mod)
|
menu:connect_signal("button::press",function(menu,item,button_id,mod)
|
||||||
if module.buttons and module.buttons[button_id] then
|
if module.buttons and module.buttons[button_id] then
|
||||||
module.buttons[button_id](item.client,menu,item,button_id,mod)
|
module.buttons[button_id](item.client,menu,item,button_id,mod)
|
||||||
|
@ -248,6 +242,7 @@ capi.client.connect_signal("property::ontop" , reload_underlay )
|
||||||
capi.client.connect_signal("property::floating", reload_underlay )
|
capi.client.connect_signal("property::floating", reload_underlay )
|
||||||
capi.client.connect_signal("property::name" , reload_content )
|
capi.client.connect_signal("property::name" , reload_content )
|
||||||
capi.client.connect_signal("property::icon" , reload_content )
|
capi.client.connect_signal("property::icon" , reload_content )
|
||||||
|
capi.client.connect_signal("property::minimized", minimize_callback )
|
||||||
|
|
||||||
return setmetatable(module, { __call = function(_, ...) return new(...) end })
|
return setmetatable(module, { __call = function(_, ...) return new(...) end })
|
||||||
-- kate: space-indent on; indent-width 2; replace-tabs on;
|
-- kate: space-indent on; indent-width 2; replace-tabs on;
|
||||||
|
|
Loading…
Reference in New Issue