Skip to content

Tags

Instead of workspaces, Pinnacle manages windows through a tag system.

Each output has a set of tags. Windows can be tagged with any number of those tags. Tags are either active or inactive. Only windows tagged with an active tag are shown on screen.

Adding tags

To add tags on an output, call the add function, providing the names of the tags to be added as well as the output. This function will return handles to all the newly created tags.

lua
local output = require("pinnacle.output").get_by_name("eDP-1")
local tags = require("pinnacle.tag").add(output, { "1", "2", "3", "4", "5" })

Manipulating tags

You can manipulate tags through the tag handles returned by add. You can also call get_all to get handles to all tags across all outputs, or get to get a tag on an output. There are also methods on output and window handles that return their tags.

There are a few methods on tag handles that manipulate a tag's active state.

MethodAction
switch_toSets all tags but this tag to inactive, and sets this tag to active. This emulates a traditional workspace.
set_active/toggle_activeSets or toggles this tag's active state
lua
local tag = require("pinnacle.tag").get("1")
tag:switch_to()
tag:set_active(true)
tag:toggle_active()

Tagging windows

When a window opens, it is automatically tagged with the active tags on the focused output.

There are a few methods on windows that manipulate tags on them.

MethodAction
set_tag/toggle_tagAdds a tag to or removes it from this window
move_to_tagRemoves all tags from this window and adds the given one. This "moves" the window to the tag.

NOTE

The behavior when tagging a window with multiple tags from different outputs is undefined. Try not to do that. In the future, Pinnacle will prevent you from adding a tag on a window that has a different output than the tags already on the window.

lua
local window = require("pinnacle.window").get_focused()
local tag = require("pinnacle.tag").get("1")
window:set_tag(tag, true)
window:toggle_tag(tag)
window:move_to_tag(tag)