Skip to content
budRich edited this page May 29, 2021 · 6 revisions

i3var - Set or get a i3 variable

SYNOPSIS

i3var set VARNAME [VALUE] [--json JSON]
i3var get VARNAME [--json JSON]
i3var --help|-h
i3var --version|-v

DESCRIPTION

i3var is used to get or set a "variable" that is bound to the current i3wm session. The variable is actually the mark on the root container.

set [VALUE]
If VARNAME doesn't exist, a new window and mark will be created. If VARNAME exists, it's value will be replaced with VALUE.
If VALUE is not defined, VARNAME will get unset (the mark is removed).

get
if VARNAME exists, its value will be printed to STDOUT.

OPTIONS

--json JSON
Use JSON instead of the output of i3-msg -t get_tree

--help|-h
Show help and exit.

--version|-v
Show version and exit.

DEPENDENCIES

bash i3

Clone this wiki locally