From fa6b7c390fbbb3afeca011d1722e45f0268aeda1 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Jul 2015 21:09:08 +0200 Subject: [PATCH] make_widget: keep original "tostring" value in parenthesis This provides the usual table ID, which can be useful during debugging. --- lib/wibox/widget/base.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wibox/widget/base.lua b/lib/wibox/widget/base.lua index fa56f0377..1a512eb91 100644 --- a/lib/wibox/widget/base.lua +++ b/lib/wibox/widget/base.lua @@ -110,8 +110,9 @@ function base.make_widget(proxy, widget_name) -- Add __tostring method to metatable. ret.widget_name = widget_name or object.modulename(3) local mt = {} + local orig_string = tostring(ret) mt.__tostring = function(o) - return ret.widget_name + return string.format("%s (%s)", ret.widget_name, orig_string) end return setmetatable(ret, mt) end