diff options
| author | Tim Keller <tjkeller.xyz> | 2025-04-16 22:36:00 -0500 | 
|---|---|---|
| committer | Tim Keller <tjkeller.xyz> | 2025-04-16 22:36:00 -0500 | 
| commit | 0db16d56d1a167be71b1b464af8f4fef3d052054 (patch) | |
| tree | 155a675ded4ad32258a4c5060c7ff0fffd74546b /widgets | |
| parent | 6595236535de799618bfdaa33c5372d94f291560 (diff) | |
| download | awesome-0db16d56d1a167be71b1b464af8f4fef3d052054.tar.xz awesome-0db16d56d1a167be71b1b464af8f4fef3d052054.zip | |
fix max not updating and refactor classiclayouts + add tooltip
Diffstat (limited to 'widgets')
| -rw-r--r-- | widgets/classiclayouts.lua | 35 | 
1 files changed, 20 insertions, 15 deletions
| diff --git a/widgets/classiclayouts.lua b/widgets/classiclayouts.lua index 1f71698..994f520 100644 --- a/widgets/classiclayouts.lua +++ b/widgets/classiclayouts.lua @@ -1,3 +1,4 @@ +local awful = require("awful")  local wibox = require("wibox")  local layout = require("awful.layout")  local beautiful = require("beautiful") @@ -33,22 +34,22 @@ function update(screen_index)  	-- create widget if not existing  	if w == nil then -		screen_widgets[s] = { widget = wibox.widget.textbox(), layout = l } -		if beautiful.font_mono then -			screen_widgets[s].widget.font = beautiful.font_mono -		end +		screen_widgets[s] = { +			widget = wibox.widget { +				font = beautiful.layoutbox_font or beautiful.font_mono or "monospace 10", +				widget = wibox.widget.textbox, +			}, +			layout = l, +			tooltip = awful.tooltip { delay_show = 1 }, +		}  		w = screen_widgets[s] -		--w._layoutbox_tooltip = tooltip {objects = {w}, delay_show = 1} - -	-- skip if no change -	elseif w.layout == l then -		return +		w.tooltip:add_to_object(w.widget)  	end  	w.layout = l  	-- set widget  	local name = layout.getname(l) -	--w._layoutbox_tooltip:set_text(name) +	w.tooltip:set_text(name)  	local wtxt = layout_icons[name]  	if type(wtxt) == 'function' then  		wtxt = wtxt(s) @@ -67,14 +68,18 @@ function update_screens()  	end  end -function update_current_tag(t) +function update_tag(t)  	update(t.screen)  end -tag.connect_signal("property::selected", update_current_tag) -tag.connect_signal("property::layout",   update_current_tag) -tag.connect_signal("tagged",             update_current_tag) -- max -tag.connect_signal("untagged",           update_current_tag) -- max +function update_client(c) +	update(c.screen) +end + +tag.connect_signal("property::selected", update_tag) +tag.connect_signal("property::layout",   update_tag) +tag.connect_signal("tagged",             update_client) -- max +tag.connect_signal("untagged",           update_client) -- max  tag.connect_signal("property::screen",   update_screens)  return update | 
