How to get current tag name in awesome wm?

I am looking to replace the tag list in awesome WM with a simple text field that displays only the name of the current tag. I tried to create a text box containing the following code:

mytagbox = widget({ type = "textbox" }) mytagbox.text = awful.tag.selected(s).getproperty("name") 

But this does not work and returns to its default configuration. What is the correct code I need to contribute to make this possible? I also use Shifty. Thanks

+7
source share
2 answers

You were close to the right path:

 screen[1]:connect_signal("tag::history::update", function() mytagbox.text = awful.tag.selected(1).name end) -- Or add_signal on awesome < 3.5 

So mytagbox.text will change every time you switch tags.

+11
source

Another solution would be to change the filter function in the taglist

 mytaglist[s] = awful.widget.taglist(s, function(t, args) return t.selected end, mytaglist.buttons) 
0
source

All Articles