Repository navigation
Power menu and hooks
The bar's power button (⏻) opens a menu with Lock, Reboot and Power off, and Log out once
[quick] logout is set. You can add rows of your own after them, and run a command when something
changes in the shell.
# ~/.config/alpheus/bar.toml
# Two rows after the fixed ones; the second asks first. Reboot, Power off and the second row count 5 s once confirmed.
[power]
countdown = 5
[[power.entry]]
name = "Clear failed units"
icon = "✓"
run = ["systemctl", "--user", "reset-failed"]
[[power.entry]]
name = "Firmware setup"
icon = "⚙"
run = ["systemctl", "reboot", "--firmware-setup"]
confirm = trueA row needs a name (1 to 24 characters) and a run (an argv list, never a shell, never waited
for). icon is one character. confirm = true makes the row ask first, as Reboot does: a second
activation 0.4 to 3 seconds later runs it. countdown in [power] counts that many seconds (up to 30)
after the confirming step, and Esc cancels; a row can set its own countdown, which wins over the global
one.
You can add at most 8 rows. They follow the fixed ones, in file order; builtins = false in
[power] hides the four fixed rows from the ⏻ menu (the quick panel keeps its buttons).
alpheus never handles sleep or the screens' power: a run holding suspend, hibernate,
hybrid-sleep, dpms, power-off-monitors or wlopm anywhere in an argument (and any argument
containing dpm, a path included) makes the whole bar.toml invalid. Keep Sway's
output … power off out of the menu yourself.
# ~/.config/alpheus/bar.toml
# Pause the music when do not disturb turns on, and follow the theme mode in GTK apps.
[hooks]
dnd = ["sh", "-c", '[ "$ALPHEUS_DND" = on ] && playerctl pause']
theme_mode = ["sh", "-c", 'gsettings set org.gnome.desktop.interface color-scheme "prefer-$ALPHEUS_MODE"']A hook is a command run once, detached, when an event happens. Its data arrives in ALPHEUS_*
variables, never as arguments, so a hook that reads them goes through sh -c and quotes them. Here
dnd fires when do not disturb turns on or off (ALPHEUS_DND is on or off) and theme_mode when
the mode in effect changes (ALPHEUS_MODE is dark or light). There are thirteen events, a
hook fires on a change and not for the state at start (except started, which fires once when the
daemon is up), and some need a module in modules: dnd needs notifications, which is in the
default list. The variables of each event are in the
event hooks page.
bar.toml is read once: restart alpheus-demon (see Getting started).
A ninth row, a name or icon of the wrong length, a forbidden word in run, a typo in a key, or
an unknown hook event discards the whole bar.toml, with a warning in the daemon's standard error
(a message about a row names it by position, such as power.entry 2). A hook that does not run says why in the
log, in fixed words. Hooks are rate-limited: five runs of one event at once, then one more every
3 seconds.