Tagging¶
Tags 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.
There are two ways to define a tag in the config:
Simple¶
The simple way just needs a name and a regular expression to just handle the placement:
1 tag "tagname", "xterm"
Extended¶
Additionally 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.
Numbers: on /off1 tag "tag" do
2 match "xterm|[u]?rxvt"
3 gravity :center
4 end
Default¶
Whenever a client has no tags it gets the default tag and is placed on the default view.
Example:
Numbers: on /off1 view "terms", "terms",
2 view "www", "default|browser",
3 view "dev", "editor"
Properties¶
Following properties exist:
Borderless¶
This property enables the borderless mode for tagged clients.
Numbers: on /off1 tag "borderless" do
2 match "xterm"
3 borderless true
4 end
Center¶
This property enables the center mode for tagged clients.
Numbers: on /off1 tag "center" do
2 match "xterm"
3 center true
4 end
Fixed¶
This property enables the fixed mode for tagged clients.
Numbers: on /off1 tag "fixed" do
2 match "xterm"
3 fixed true
4 end
Float¶
This property enables the floating mode tagged clients.
Numbers: on /off1 tag "float" do
2 match"xterm"
3 float true
4 end
Full¶
This property enables the fullscreen mode for tagged clients.
Numbers: on /off1 tag "full" do
2 match "xterm"
3 full true
4 end
Geometry¶
This property sets a certain geometry as well as floating to the tagged client, but only on views that have this tag too. It expects an array with x, y, width and height values whereas width and height must be >0.
Numbers: on /off1 tag "geometry" do
2 match "xterm"
3 geometry [ 10, 10, 100, 100 ]
4 end
Gravity¶
This property sets a certain to gravity to the tagged client, but only on matching views.
Numbers: on /off1 tag "gravity" do
2 match "xterm"
3 gravity :center
4 end
Match¶
This property adds a matcher to a tag, that is either a simple regular expression (see regex) or a selector based on different values/properties of a client.
Regular expression¶
When a regular expression is used, subtle uses both parts of the WM_CLASS property for matching.
Selector¶
A selector is a more complicated, but finer grained way to match clients and it even allows to combine multiple matcher with simple boolean logic.
Every selector consists of a type and a value:
Numbers: on /off1 tag "example" do
2 match type: value
3 end
Following types exist:
:name | Match the window name |
:instance | Match the window instance name |
:class | Match the window class name |
:role | Match the window role |
:type | Match the window type |
Boolean logic¶
Boolean logic allows to select a broader range of clients without difficult regular expressions and/or a required combination of multiple selector types.
AND
All selector are required in order for this tag to be applied.
Numbers: on /off1 tag "AND" do
2 match instance: "xterm", instance: "urxvt"
3 end
OR
Only one matching selector is required in order for this tag to be applied.
Numbers: on /off1 tag "OR" do
2 match "xterm"
3 match "urxvt"
4 end
Please also check the How do I tag console based programs? FAQ entry.
On_match¶
This property adds Ruby proc to a tag that is called whenever the tag is applied to a client. This allows to add logic to a tag to ease e.g. simple placement tags.
Numbers: on /off1 tag "gimp" do
2 match role: "gimp.*"
3
4 on_match do |c|
5 c.gravity = ("gimp_" + c.role.split("-")[1]).to_sym
6 end
7 end
Position¶
Similar to the geometry property, this property just sets the x/y coordinates of the tagged client, but only on views that have this tag, too. It expects an array with x and y values.
Numbers: on /off1 tag "position" do
2 match "xterm"
3 position [ 10, 10 ]
4 end
Resize¶
This property enables 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.
Numbers: on /off1 tag "resize" do
2 match "xterm"
3 resize true
4 end
Stick¶
This property enables the sticky mode for tagged clients. When set, clients are visible on all view, even when they don't have matching tags. On multihead sticky clients stay on the current screen as long as they are [Clients#Sticky|sticky]].
r3164
Supported values are either true or a number to specify a screen.
Numbers: on /off1 tag "stick" do
2 match "xterm"
3 stick true
4 end
Type¶
This property sets the tagged client to be treated as a specific window type though as the window sets the type itself.
Following types are possible:
:normal | Treat as normal window |
:desktop | Treat as desktop window (_NET_WM_WINDOW_TYPE_DESKTOP) |
:dock | Treat as dock window (_NET_WM_WINDOW_TYPE_DOCK) |
:toolbar | Treat as toolbar windows (_NET_WM_WINDOW_TYPE_TOOLBAR) |
:splash | Treat as splash window (_NET_WM_WINDOW_TYPE_SPLASH) |
:dialog | Treat as dialog window (_NET_WM_WINDOW_TYPE_DIALOG) |
Numbers: on /off1 tag "desktop" do
2 match "xterm"
3 type :desktop
4 end
Urgent¶
This property enables the urgent mode for tagged clients. When set, subtle automatically sets this client to [Clients#Urgent|urgent]].
Numbers: on /off1 tag "urgent" do
2 match "xterm"
3 urgent true
4 end
Zaphod¶
This property enables the zaphod mode for tagged clients. When set, the client spans across all connected screens.
Numbers: on /off1 tag "zaphod" do
2 match "xterm"
3 zaphod true
4 end
Examples¶
Numbers: on /off 1 tag "bashrun" do
2 match "bashrun"
3 geometry [ 50, 1000, 200, 28 ]#
4 stick true
5 urgent true
6 end
7
8 tag "browser" do
9 match "chrom[e|ium]"
10 gravity :center
11 end