Project

General

Profile

Tag client by class AND view it's started from ?

Added by david unric about 8 years ago

Hi,

how can I tag client not only by its WM_CLASS but also by the current view it's started from ?

Something like:

tag "devel"
(match :class => "xterm") and (Subtlext::View.current.name == "dev")
end

I'd like to achieve if terminal is started from view named "dev" it won't go to 1st view "terms" as by default but stays on the view "dev".

Any idea ?


Replies (3)

RE: Tag client by class AND view it's started from ? - Added by Christoph Kappel about 8 years ago

You cannot use subtlext in that way, tags are just read once and then moved to the C part of subtle.

The easiest way to do that is with the Launcher from subtle-contrib. With it you can start your terminal like urxvt @dev (with autocompletion for apps and views) and it will tag the window to stay on the dev view.

Another option is to use a hook to adapt the tagging for this window like the current view snippet.

RE: Tag client by class AND view it's started from ? - Added by david unric about 8 years ago

Thx Christoph !

The terminal gets spawned either manually from Launcher but also from gVim editor and possibly by other ways so I've looked for a more generic solution. Adding of tag replacement code to client_create hook did the job.

Great.

RE: Tag client by class AND view it's started from ? - Added by Christoph Kappel about 8 years ago

Yep, that should work, but requires to check many things before you retag the window. And yw. ;)

    (1-3/3)