Next: (heks-linux wezterm), Previous: (heks-linux wallpaper), Up: API
Default value:
"heks-about"
Default value:
"#1b1b1d"
Default value:
"#f2f3f5"
Default value:
#f
Default value:
1
Default value:
0.5
Default value:
15
Default value:
30
Default value:
"0px"
Default value:
"clipman pick --tool=rofi"
Default value:
"@{:%a %d %b %H:%M@}"
Default value:
60
Default value:
"/root/.config/waybar"
Default value:
"config.jsonc"
Default value:
""
Default value:
"11pt"
Default value:
30
Default value:
0.12
Default value:
"6px"
Default value:
"heks-language-label"
Default value:
"heks-language-menu"
Default value:
"/root/.local/bin"
Default value:
"0px"
Default value:
"0px"
Default value:
"0px"
Default value:
"0px"
Default value:
"/root/.local/bin"
Default value:
"heks-media-menu"
Default value:
#(custom/heks-system-menu custom/heks-spotlight niri/window)
Default value:
#(custom/media custom/heks-clipboard custom/heks-password custom/mako-dnd custom/heks-language custom/heks-palette custom/heks-wallpaper custom/heks-docs custom/heks-keys cpu memory backlight pulseaudio keyboard-state battery power-profiles-daemon tray clock)
Default value:
#f
Default value:
"\uf084"
Default value:
"1Password"
Default value:
top
Default value:
"rofi -show drun"
Default value:
"style.css"
Default value:
"/root/.local/bin"
Default value:
"heks-system-menu"
Default value:
"Heks"
Write config.jsonc and style.css, plus the scripts the bar launches - the system menu, the About window, the media popover and the keyboard-layout pair - under ~/.local/bin.
Local overrides are read from
$XDG_CONFIG_HOME/heks-linux/waybar-settings.scm first, and the
stylesheet ends with waybar-extra-css, so a machine can override
any rule the generator writes. Waybar has no hot reload, so restart it
after a change.
Render the About This Heks window as a Bash script.
The system menu’s first row answers the question every desktop’s first row answers - what am I running - and it is a small GTK dialog rather than a second Rofi menu: the row that opens it is itself a row of a Rofi menu, and two menus at once would race for the keyboard grab. On a machine with no zenity the same fields go to the notification daemon, so the row is never a click that does nothing.
The layout is About This Mac’s, from Mavericks: the machine’s name and the system it runs at the top, then one line per fact with the label bold and the value beside it - including a startup disk, which on a Mac is a disk’s name and here is the space left on the root filesystem.
The palette is baked in at render time, the way the palette picker’s current name is, so the window says which palette the desktop is wearing without having to find and parse the settings file at click time.
Return the PulseAudio volume indicator. Shows the volume as one glyph and one number, with a Bluetooth badge when a headset is connected.
Return the screen backlight indicator. Shows the brightness percentage with a glyph that brightens as the value rises.
Three ways to move it, because brightness is the readout people adjust most: the wheel for a nudge, a click for a nudge the other way, and a right click to go straight back to full. The tooltip says all three - a menu bar item that needs to be discovered by trying it is a puzzle, not a control.
Return the bar’s own styling attributes.
The bar is the material above - the wallpaper seen through a tinted
veil, with a lit top edge and a hairline at its foot - and its text
carries a shadow so it survives a wallpaper of any tone.
waybar-bar-tint decides how much of the palette the veil carries
and waybar-bar-opacity how opaque it is - or, by default, the
palette’s own waybar-opacity - so the bar belongs to the theme it
is wearing.
The drop shadow under the bar is the compositor’s, not this
stylesheet’s: a Wayland layer surface cannot draw outside its own
rectangle, so a CSS box-shadow here would be clipped away.
(heks-linux niri) asks niri for the layer’s shadow instead. The
box-shadow below is kept for the compositors that read the bar’s own CSS
and clip it anyway, and it is subtle for that reason.
Return the battery indicator. The warning and critical thresholds come from the module parameters, and the glyph changes while the machine is charging.
The tooltip is where the numbers that do not fit on a menu bar go: how long is left, how much power is being drawn, and how worn the pack is - the three things a battery readout is asked when it is not being glanced at. A click opens the session menu, which is the only thing anybody does about a battery that is nearly flat.
Return the clipboard button: one clipboard glyph, the history behind it.
Clicking it opens the history picker the compositor binds to Mod+V -
clipman’s own pick mode, which puts the chosen entry back on the
clipboard. A bar click is not the compositor, so the picker is spawned
the way every other bar menu is: after a pkill rofi, because a
second rofi while one is open would refuse to start rather than take the
click. The glyph is the solid clipboard from the bar’s first font,
which is the same alphabet as its neighbours.
Return the clock. Its format string and refresh interval are parameters, so the bar can show seconds or a longer date without touching the renderer.
Its tooltip is the month, laid out as a calendar, which is the one thing a date on a menu bar is asked to explain. A right click copies the exact time instead, because the other reason to look at a clock is to write the time down.
WayBar configuration, defined in Guile Scheme, a status bar with a detailed, modular setup.
Defines a CSS configuration for Heks-Linux Waybar using Scheme.
Return the documentation button: one book glyph, beside the wall chooser.
Clicking it opens the documentation view of heks-toon, which reads this machine’s own READMEs rather than a second copy written for the window, so the page cannot say something the checkouts do not. It sits with the palette and wall glyphs because all three are the same question - what is this desktop - and the book is how the bar answers it without a browser tab.
A right click is for the reader who wants the reference rather than the prose: the published API documentation, which is generated from these modules’ own docstrings.
Return glyph marked up so that the icon face draws it.
The stylesheet can name only one family for the whole bar - GTK reads a quoted comma list as a single family *name* - so the family there is the text font, and the icons would otherwise arrive through Pango’s per-character fallback. That fallback asks fontconfig for a face *at the bar’s weight*, and at a regular weight it is Font Awesome’s Regular face, whose glyph for a codepoint is not always the one the bar meant: U+F518 came out as a slashed circle where the book belongs. A markup span is the one place in a label where a font can be named for a single run of text, so every icon is named here, once, and the text is left to the stylesheet.
glyph is a private-use codepoint from Font Awesome 6 Free Solid.
Return the question-mark button that opens the keyboard reference. The reference is one view of heks-toon, which the bar only has to launch. A right click keeps the project page reachable now that this is the bar’s only question mark. The glyph is Font Awesome’s circled question mark rather than a typed "?" - the bar is a row of glyphs, and a character from the text font was the one item in it that was not one.
Return the keyboard-layout item: the layout in capitals, a menu behind it.
Niri reports its layouts by their display name - "English (US)" - and
its own module has no short form, which left the bar with one full
sentence among a row of glyphs and numbers. This is a custom item
instead: heks-language-label prints the two-letter code,
heks-language-menu is the picker behind a click, and the right
button steps back one layout without opening anything.
The label is not refreshed on a timer. It is read once, and again when
the menu switches a layout and pokes waybar with SIGRTMIN+8 - the
signal this item declares. Two letters are not a sentence either, so
the tooltip is where the long name and the two buttons are written down.
Render the script that prints the bar’s keyboard-layout label.
It prints the XKB code of the layout in use, in capitals - "US", "NL" -
which is what a menu bar does with a locale: two letters, not a
sentence. The codes are baked in from
heks-linux-keyboard-layout, in the same order niri numbers its
layouts, because the display name niri reports ("English (US)") is not
something the bar has room for.
Render the keyboard-layout menu behind the bar’s language item.
A Rofi list of the layouts niri knows, the one in use marked, and a choice that cycles to it: niri can only step a layout at a time, so a menu entry is "press next until it is the one I picked". The clever half is choosing the shorter direction, so picking the last layout does not walk through the whole list. The window is only as tall as the list, because a desktop usually has two layouts and a four row dialog around one of them is three empty rows.
After switching it pokes waybar with SIGRTMIN+8, which is the
signal the bar’s language item watches, so the label changes at once
instead of waiting for the next refresh.
Do-not-disturb indicator. Shows a slashed bell while mako’s
do-not-disturb mode is active, and toggles it on click. The word
it used to show - DND - was the only sentence among the bar’s
glyphs.
The tooltip is written out rather than taken from the script, because the script prints one glyph and nothing else. It can be: the item is only on the bar while the mode is on, so the tooltip has only one thing to say.
Return the now-playing button: one glyph, with the track in its tooltip.
Clicking it opens the media popover - a small Rofi menu of transport controls that appears under the bar, the way Control Center’s Now Playing does. The bar itself stays a row of glyphs, which is the whole point of moving the title out of it: a menu bar names the app you are in, not the song you are playing.
The three mouse buttons are the transport, so the common case needs no menu at all: a right click plays or pauses and a middle click skips, and the tooltip names the track and both.
Render the media popover as a Bash script.
It is a Rofi dmenu menu rather than a GTK menu, so it wears the same
glass as the launcher, shows the track and the player state above the
list, and can be driven from the keyboard. Every action goes through
playerctl, which is what the bar’s glyph watches.
Return the palette button: one glyph, in the palette’s own accent.
Clicking it opens the palette chooser view of heks-toon, where every palette is a card painted in its own colours; choosing one runs the same Rofi picker the swatches come from, so a switch reads the same whichever way it was started. The name of the palette moved into the tooltip when the bar learned to look like a menu bar - a menu bar carries glyphs, not sentences - and the glyph is Font Awesome’s palette rather than a text label.
A right click is the short way round: the Rofi swatch picker on its own, for the switch that does not need the window.
Return the password-manager button: one key glyph, the vault behind it.
The glyph is Font Awesome’s key, and not a padlock: a padlock says "this
is locked", which is what the caps-lock indicator already says, while a
key says "the passwords are behind here" - which is the one thing a
password manager’s menu-bar item has to say. Font Awesome’s keyhole is
a Pro glyph, and its free lookalike at U+F13E turned out to be the
*open* padlock, which reads as the opposite of a vault. The glyph
itself is waybar-password-icon.
The program is the machine’s heks-linux-password-command unless
the bar overrides it, so a machine that installed 1Password from its
distribution and one that installed the Flatpak both work without
editing this module; the name in the tooltip is
waybar-password-label, so pointing the glyph elsewhere does not
leave 1Password’s name on somebody else’s vault. The click is spawned
through the compositor like the other windows the bar opens: a 1Password
that is already running - it starts at login with --silent - has
to be raised, and a client cannot raise a window without an activation
token. The pkill rofi in front is the same courtesy every bar
menu pays: an open launcher would otherwise swallow the click.
Return the command the key glyph runs.
Either the bar’s own override (waybar-password-command) or, when
that is #f, the machine’s password manager from (heks-linux
user-settings) - the same command the session starts at login, so the
app the bar opens is the app that is already running.
Return the power-profiles-daemon indicator. Shows the active profile with a per-profile glyph and names the driver in its tooltip.
The item only exists where power-profiles-daemon does: waybar hides the module when nothing answers on the bus. So do its buttons - a machine that has the daemon has the CLI that cycles it, and a machine without both never sees the glyph to click.
Return the spotlight button: one glyph, next to the logo.
Rofi is this desktop’s Spotlight, and it used to hide behind the bar’s own label - the leftmost item was a launcher. Now that the leftmost item is the system menu, the thing a menu bar keeps there, the launcher gets a glyph of its own so it is not one click further away than it was. A left click opens the launcher and a right click the window switcher, which is the other half of what Spotlight does.
The glyph is the app grid, Font Awesome’s grip, and not the magnifier a Mac Spotlight wears. That is not a Preference: U+F002 is claimed by Arial’s symbol table, so on a machine with the Microsoft core fonts Pango draws the ligature "fl" there instead of a magnifier, and a broken glyph on the far left of the menu bar is the first thing anyone sees. U+F58D is claimed by Font Awesome and nothing else, so it draws every time - and it is the mark an app launcher wears on every other desktop anyway.
Return the whole stylesheet: the generated rules, then the machine’s own CSS.
The two are one string because they are one file:
waybar-extra-css is appended rather than merged, so the last word
belongs to the machine and it can override any rule above it - including
the material’s, which is why no parameter has to exist for every
property a stylesheet can carry.
Render the bar’s system menu as a Bash script.
It is a Rofi script-mode menu, like the power menu and the palette
picker: it wears the same glass as the launcher, it can be driven from
the keyboard, and it needs nothing of GTK’s menu widgets. Rofi calls it
with ROFI_RETV unset to list the rows, and with ROFI_RETV
set to 1 and the chosen row in the first argument to run that row’s
action.
Called with no ROFI_RETV at all it is the bar that is calling, so
the script opens Rofi with itself as a script-mode module - -modi
hands Rofi the file. One generated file is therefore both the rows and
the way to reach them, and config.rasi needs no entry per menu
the bar owns. The window is pinned under the logo at the top left and
is exactly as tall as its list, which is what a menu dropping from a
menu bar does.
Every action is detached, and that is not tidiness: Rofi reads this script’s standard output as its list of rows, so a program still writing into that pipe when the menu closes dies of SIGPIPE instead of opening.
Return the system menu button: the wordmark at the far left of the bar.
It is the bar’s Apple menu - the one item that belongs to the machine rather than to whatever is open - so it carries the desktop’s own name rather than Apple’s mark. The lambda said which language this desktop is written in, which is a fact about the desktop and not about the click: a menu bar’s first item is a place to be found, not decoded. A left click opens the menu and a right click goes straight to the session rows; the tooltip says both.
Return the rows of the bar’s system menu, top to bottom.
Each row is (label icon command), and
waybar-system-menu-rule is a rule between two groups. The shape
is the one a Mac’s Apple menu has: what this machine is, the ways into
it, and then the ways out of the session. The last group is
rofi-power-menu-entries - the very rows Rofi’s own power mode
offers - instead of a second copy of the six commands, so the menu under
the logo and the power menu on a right click cannot drift apart.
Return the window taskbar. Lists open windows with their icons and titles; a click activates a window and a middle click minimizes it.
Return the wallpaper button: one picture glyph, next to the palette.
Clicking it opens the wall chooser view of heks-toon, the collection with a large preview of whatever is selected - the same window ~Mod+Shift+W~ opens. It sits beside the palette glyph because the two are the same kind of thing - the two halves of how the desktop looks - so a menu bar answers the question of how it looks from one place.
A right click shuffles instead, which is what ~Mod+Shift+B~ does: the wall is the one thing on this desktop that can be changed without being chosen.
Next: (heks-linux wezterm), Previous: (heks-linux wallpaper), Up: API