Next: , Previous: , Up: API  


1.19 (heks-linux rofi)

1.19.1 Parameters

Parameter: rofi-config-dir

Default value:

"/root/.config/rofi"
Parameter: rofi-config-filename

Default value:

"config.rasi"
Parameter: rofi-icon-theme

Default value:

"skeu-icons-violet-dark"
Parameter: rofi-power-menu-dir

Default value:

"/root/.local/bin"
Parameter: rofi-power-menu-filename

Default value:

"heks-rofi-power-menu"
Parameter: rofi-theme-filename

Default value:

"sss-theme.rasi"
Parameter: rofi-theme-menu-dir

Default value:

"/root/.local/bin"
Parameter: rofi-theme-menu-filename

Default value:

"heks-rofi-theme-menu"
Parameter: rofi-window-radius

Default value:

18

1.19.2 Procedures

Procedure: install-rofi-config

Write the launcher config and theme, plus the power and theme-picker scripts. Local overrides are read from $XDG_CONFIG_HOME/heks-linux/rofi-settings.scm first. The two generated scripts are what make rofi -show power and rofi -show theme work.

Procedure: make-rofi-power-menu-script

Generate the Bash script implementing the Rofi power script mode.

Rofi calls it with ROFI_RETV=0 to list the entries and with ROFI_RETV=1 (the chosen entry as $1) to execute its action.

Procedure: make-rofi-theme-menu-script

Generate the Bash script implementing the Rofi theme script mode.

Choosing an entry rewrites ~/.config/heks-linux/local-settings.scm (keeping a .bak of the previous file), runs maak install-theme to re-render every palette-dependent dotfile, and then loads the matching Emacs theme into the running daemon.

Three details make this feel like a switch rather than a rebuild. Each palette is previewed with a swatch built from its own colours, so choosing a theme is a visual decision instead of a guess at a name. The Emacs theme comes from a generated table rather than from the palette name, because several palettes wear a theme called something else - heavy-metal wears ef-tritanopia-dark, for instance. And the swatches are cached under $XDG_CACHE_HOME, fingerprinted by the palette table, so the first open builds them once and every later open is instant.

Procedure: rofi-configuration

Render the Rofi config.rasi file.

The launcher is registered with four modes: drun (applications), window (the Cmd-Tab style switcher), power (session actions) and theme (the palette picker). The two script modes live in ~/.local/bin next to this configuration.

The mouse is a first-class way to pick an entry, not a second one. Rofi’s default is that a click only moves the selection and a second click (or Return) accepts it, which on a launcher reads as a double click that sometimes works. The three options below are Rofi’s own recipe for the other behaviour - the selection follows the pointer, and one click accepts - so a launcher can be used with one hand on the mouse and no Return at all.

Procedure: rofi-power-menu-entries

Ordered list of Rofi power-menu entries, each as (label icon command).

Procedure: rofi-theme

Return the Rofi theme as a list of CSS rulesets. Every colour is looked up in the current palette, so the launcher follows the theme. The result is rendered with mk-css-conf-lines.


Next: (heks-linux ssh), Previous: (heks-linux rmpc), Up: API