You are not logged in.

#1 2012-10-29 08:39:15

tvler
Member
Registered: 2012-10-29
Posts: 3

[awesome wm] how can I start specific programs when tags are selected

for example: opening the tag 'chromium' will launch a new chromium client.

I only want a new client to launch if the tag is (1) currently empty and (2) not selected, but I can't seem to make a function that can test both these things.

Offline

#2 2012-10-29 15:02:04

Yggdrasil
Member
Registered: 2009-07-21
Posts: 37

Re: [awesome wm] how can I start specific programs when tags are selected

I don't really get your (2) point. "Opening" a tag and "selecting" a tag is the same for me.

Here an example how to start a terminal when selecting an empty tag 8:

tags[1][8]:add_signal(
	"property::selected",
	function(tag)
		if tag.selected and next(tag:clients())==nil then
			awful.util.spawn(terminal)
		end
	end)

Only problem with this: If you already have some tags selected and add the empty tag 8 to your selection, the spawned program gets tagged with every selected tag, not just tag 8. But that's just a minor thing and easily avoided.

Offline

Board footer

Powered by FluxBB