tofi
tofi is a Wayland-native menu / launcher. Some distributions ship helper
binaries such as tofi-run and tofi-drun.
This module constructs
ward.process.cmd(...)invocations; it does not parse output. consumers can usewardlib.tools.out(or their own parsing) on the:output()result.
Import
local Tofi = require("wardlib.app.tofi").Tofi
API
Tofi.bin
Executable name or path (default: "tofi").
Tofi.bin_run
Executable name or path (default: "tofi-run").
Tofi.bin_drun
Executable name or path (default: "tofi-drun").
Tofi.menu(opts)
Builds: tofi <opts...>
Tofi.run(opts)
Builds: tofi-run <opts...>
Tofi.drun(opts)
Builds: tofi-drun <opts...>
Options
TofiOpts
config: string?→-c <file>prompt_text: string?→--prompt-text <text>num_results: number?→--num-results <n>require_match: boolean?→--require-matchfuzzy_match: boolean?→--fuzzy-matchwidth: string?→--width <w>height: string?→--height <h>font: string?→--font <font>defines: table<string, any>?→ additional--key <value>pairs- stable key order
trueemits--keyfalse/nilare skipped
extra: string[]?→ extra argv appended after modeled options
Examples
tofi-run with a prompt
local Tofi = require("wardlib.app.tofi").Tofi
Tofi.run({
config = "tofi.conf",
prompt_text = "Run",
require_match = true,
}):output()