Class pinnacle.tag.TagHandle
A tag handle.
This is a handle that allows manipulation of a tag.
This can be retrieved through the various get
functions in the Tag
module.
Fields
id
id
: integer
Functions
method remove
function pinnacle.tag.TagHandle:remove()
Removes this tag.
Example
lua
local tags = Tag.add(Output.get_by_name("HDMI-1"), "1", "2", "Buckle", "Shoe")
tags[2]:remove()
tags[4]:remove()
-- "HDMI-1" now only has tags "1" and "Buckle"
method switch_to
function pinnacle.tag.TagHandle:switch_to()
Activates this tag and deactivates all other ones on the same output.
Example
lua
-- Assume the focused output has the following inactive tags and windows:
-- - "1": Alacritty
-- - "2": Firefox, Discord
-- - "3": Steam
Tag.get("2"):switch_to() -- Displays Firefox and Discord
Tag.get("3"):switch_to() -- Displays Steam
method set_active
function pinnacle.tag.TagHandle:set_active(active: boolean)
Sets whether or not this tag is active.
Example
lua
-- Assume the focused output has the following inactive tags and windows:
-- - "1": Alacritty
-- - "2": Firefox, Discord
-- - "3": Steam
Tag.get("2"):set_active(true) -- Displays Firefox and Discord
Tag.get("3"):set_active(true) -- Displays Firefox, Discord, and Steam
Tag.get("2"):set_active(false) -- Displays Steam
Parameters
active
: boolean
method toggle_active
function pinnacle.tag.TagHandle:toggle_active()
Toggles this tag's active state.
Example
lua
-- Assume the focused output has the following inactive tags and windows:
-- - "1": Alacritty
-- - "2": Firefox, Discord
-- - "3": Steam
Tag.get("2"):toggle_active() -- Displays Firefox and Discord
Tag.get("2"):toggle_active() -- Displays nothing
method active
function pinnacle.tag.TagHandle:active()
-> boolean
Gets whether or not this tag is active.
Returns
boolean
method name
function pinnacle.tag.TagHandle:name()
-> string
Gets this tag's name.
Returns
string
method output
function pinnacle.tag.TagHandle:output()
-> pinnacle.output.OutputHandle
Gets the output this tag is on.
Returns
method windows
function pinnacle.tag.TagHandle:windows()
-> pinnacle.window.WindowHandle[]
Gets the windows that have this tag.