Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve current tag name in awesome wm?

Tags:

awesome-wm

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

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

But this does not work and reverts awesome to its default config. What is the correct code I need to put in to make this possible? I'm also using Shifty. Thanks

like image 996
semiserious Avatar asked Jan 22 '12 20:01

semiserious


1 Answers

You were close to the correct way:

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 be changing on each tags switching.

like image 167
Taras Avatar answered Nov 07 '22 08:11

Taras