Project

General

Profile

Tagging » History » Version 63

« Previous - Version 63/66 (diff) - Next » - Current version
Anonymous, 12/22/2017 03:23 PM


Tagging\015\012\015\012{{>toc}}\015\012\015\012\015\012Tags are generally used in subtle for placement of clients. This placement is mandatory, that means that - aside from other tiling window managers - clients must have a matching tag to be on a certain view. This also includes that clients, that are started on a certain view, aren't automatically placed there.\015\012\015\012There are two ways to define a tag in the config:\015\012\015\012h2. Simple\015\012\015\012The simple way just needs a name and a regular expression to just handle the placement:\015\012\015\012
tag "tagname", "xterm"
\015\012\015\012h2. Extended\015\012\015\012Additionally tags can do a lot more then just control the placement - they also have properties to define and control some aspects of a client like the gravity or modes.\015\012\015\012
{{hide}}\015\012tag "tag" do\015\012  match   "xterm|[u]?rxvt"\015\012  gravity :center\015\012end\015\012
\015\012\015\012h2. Default\015\012\015\012Whenever a client has no tags it gets the default tag and is placed on the default view.\015\012\015\012Example:\015\012\015\012
{{hide}}\015\012view "terms", "terms",\015\012view "www", "default|browser",\015\012view "dev", "editor"\015\012
\015\012\015\012h2. Modes\015\012\015\012Following modes exist:\015\012\015\012h3. Borderless \015\012\015\012Enables the borderless mode for tagged clients. When set, any borders around the client are absent.\015\012\015\012
{{hide}}\015\012tag "borderless" do\015\012  match "xterm"\015\012  set   :borderless\015\012end
\015\012\015\012h3. Fixed\015\012\015\012Enables the fixed mode for tagged clients. When set, the client cannot be resized anymore.\015\012\015\012
{{hide}}\015\012tag "fixed" do\015\012  match "xterm"\015\012  set   :fixed\015\012end
\015\012\015\012h3. Floating\015\012\015\012This property enables the floating mode tagged clients.\015\012\015\012
{{hide}}\015\012tag "floating" do\015\012  match "xterm"\015\012  set   :floating\015\012end\015\012
\015\012\015\012h3. Full\015\012\015\012Enable the fullscreen mode for tagged clients. When set, the [[clients|client] covers the whole screen size.\015\012\015\012
{{hide}}\015\012tag "full" do\015\012  match "xterm"\015\012  set   :full\015\012end\015\012
\015\012\015\012h3. Resize\015\012\015\012Enable the resize mode for tagged clients. When set, subtle honors size hints of the clients, that define various size constraints like sizes for columns or rows of a terminal.\015\012\015\012
{{hide}}\015\012tag "resize" do\015\012  match "xterm"\015\012  set   :resize\015\012end\015\012
\015\012\015\012h3. Sticky\015\012\015\012Enable the sticky mode for tagged clients. When set, subtle keeps the [[clients|client] on the current screen, regardless of the tags.\015\012\015\012Supported values are either true or a number to specify a screen.\015\012\015\012
{{hide}}\015\012tag "sticky" do\015\012  match "xterm"\015\012  set   :sticky\015\012end\015\012
\015\012\015\012h3. Urgent\015\012\015\012Enable the urgent mode for tagged clients. When set, subtle automatically sets this client to [Clients#Urgent|urgent]].\015\012\015\012
{{hide}}\015\012tag "urgent" do\015\012  match "xterm"\015\012  set   :urgent\015\012end\015\012
\015\012\015\012h3. Zaphod\015\012\015\012Enable the zaphod mode for tagged clients. When set, the client spans across all connected screens.\015\012\015\012
{{hide}}\015\012tag "zaphod" do\015\012  match "xterm"\015\012  set   :zaphod\015\012end
\015\012\015\012h2. Options\015\012\015\012Following options exist:\015\012\015\012h3. Set\015\012\015\012Set various [[Tagging#Modes|modes] for tagged clients. Multiple modes can be set separated by comma.\015\012\015\012
{{hide}}\015\012tag "modes" do\015\012  match "xterm"\015\012  set   :floating, :sticky\015\012end\015\012
\015\012\015\012h3. Geometry\015\012\015\012Set a certain geometry for the tagged client and put it in floating mode, but only on views that have this tag in common. Expected is an array with x, y, width and height values whereas width and height must be >0.\015\012\015\012
{{hide}}\015\012tag "geometry" do\015\012  match    "xterm"\015\012  geometry [ 10, 10, 100, 100 ]\015\012end\015\012
\015\012\015\012h3. Gravity\015\012\015\012Sets a certain to gravity to the tagged client, but only on views that have this tag in common.\015\012\015\012
{{hide}}\015\012tag "gravity" do\015\012  match   "xterm"\015\012  gravity :center\015\012end\015\012
\015\012\015\012h3. Match\015\012\015\012Adds a matching patterns to a tag, this can be done more than once. Matching works either via plaintext, regular expression (see regex) or a selector based on different values/properties of a client.\015\012\015\012h4. Regular expression\015\012\015\012When a regular expression is used, subtle uses both parts of the WM_CLASS property for matching.\015\012\015\012h4. Selector\015\012\015\012A selector is a more complicated, but finer grained way to match clients and it even allows to combine multiple matcher with simple boolean logic.\015\012\015\012Every selector consists of a type and a value:\015\012\015\012
{{hide}}\015\012tag "example" do\015\012  match type: value\015\012end\015\012
\015\012\015\012Following types exist:\015\012\015\012| :name | Match the window name |\015\012| :instance | Match the window instance name |\015\012| :class | Match the window class name |\015\012| :role | Match the window role |\015\012| :type | Match the window type |\015\012\015\012{{needs(r2830)}}\015\012\015\012h4. Boolean logic\015\012\015\012Boolean logic allows to select a broader range of clients without difficult regular expressions and/or a required combination of multiple selector types.\015\012\015\012h5. AND\015\012\015\012All selector are required in order for this tag to be applied.\015\012\015\012
{{hide}}\015\012tag "AND" do\015\012  match instance: "xterm", instance: "urxvt"\015\012end\015\012
\015\012\015\012h5. OR\015\012\015\012Only one matching selector is required in order for this tag to be applied.\015\012\015\012
{{hide}}\015\012tag "OR" do\015\012  match "xterm"\015\012  match "urxvt"\015\012end\015\012
\015\012\015\012{{info(When dealing with console-based apps please keep in mind, that tagging via WM_NAME won't work as expected. Tags are usually applied when the terminal starts and before the shell with the app is spawned.)}}\015\012\015\012Please also check the How do I tag console based programs? FAQ entry.\015\012\015\012{{needs(r3209)}}\015\012\015\012h3. On_match\015\012\015\012Add a Ruby proc to a tag that is executed whenever the tag is applied to a client. This allows to add logic to a tag to ease e.g. simple placement tags.\015\012\015\012
{{hide}}\015\012tag "gimp" do\015\012  match role: "gimp.*"\015\012\015\012  on_match do |c|\015\012    c.gravity = ("gimp_" + c.role.split("-")[1]).to_sym\015\012  end\015\012end\015\012
\015\012\015\012h3. Position\015\012\015\012Similar to the geometry option, set the x/y coordinates of the tagged client, but only on views with common tag. \015\012\015\012Expected is an array with x and y values.\015\012\015\012
{{hide}}\015\012tag "position" do\015\012  match    "xterm"\015\012  position [ 10, 10 ]\015\012end\015\012
\015\012\015\012h3. Type\015\012\015\012Set the window type of the tagged client, this forces it to be treated as a specific window type though as the window sets the type itself. \015\012\015\012Following types are possible:\015\012\015\012{{needs(r2905)}}\015\012\015\012| :normal | Treat as normal window |\015\012| :desktop | Treat as desktop window (_NET_WM_WINDOW_TYPE_DESKTOP) |\015\012| :dock | Treat as dock window (_NET_WM_WINDOW_TYPE_DOCK) |\015\012| :toolbar | Treat as toolbar windows (_NET_WM_WINDOW_TYPE_TOOLBAR) |\015\012| :splash | Treat as splash window (_NET_WM_WINDOW_TYPE_SPLASH) |\015\012| :dialog | Treat as dialog window (_NET_WM_WINDOW_TYPE_DIALOG) |\015\012\015\012
{{hide}}\015\012tag "desktop" do\015\012  match   "xterm"\015\012  type    :desktop\015\012end\015\012
\015\012\015\012h2. Examples\015\012\015\012
{{hide}}\015\012tag "bashrun" do\015\012  match    "bashrun"\015\012  geometry [ 50, 1000, 200, 28 ]#\015\012  stick    true\015\012  urgent   true\015\012end\015\012\015\012tag "browser" do\015\012  match   "chrom[e|ium]"\015\012  gravity :center\015\012end\015\012