5.5 KiB
ANODE session autostart
ANODE supports i3-style session-specific autostart directives paired with per-profile overrides, autostart.d/ drop-ins, and ANODE-filtered XDG .desktop entries.
Startup lifecycle
anode-sessionscrubs stale third-party DE environment variables, exportsXDG_CURRENT_DESKTOP=ANODE,XDG_SESSION_DESKTOP=anode,DESKTOP_SESSION=anode,XDG_SESSION_TYPE=x11, andANODE_SESSION_PROFILEwhen--profile NAMEor--profile=NAMEis passed, and supports--replaceand--no-autostart.- On first session launch,
anode-sessioncreates~/.config/anode/autostart.d/and copiesPREFIX/share/anode/autostart(falling back todata/autostartin source checkouts) to~/.config/anode/autostartif absent. - Unless
--no-autostartis passed, oncedwmadvertises_NET_SUPPORTING_WM_CHECKwhose_NET_WM_NAMEcontainsANODE(polled withxpropfor up to 5 s, falling back tosleep 1),anode-sessionlaunchesanode-autostart startin the background. - Pressing
Mod4 + Shift + r(reloadxreswitharg->i = 1) or sendingSIGHUPtodwm(liveexecvprestart carryingANODE_DWM_RESTARTED=1) triggersanode-autostart reload, re-running onlyexec_alwaysentries. Background theme/DPI reloads viaSIGUSR1orXA_RESOURCE_MANAGERpassNULLand do not re-triggeranode-autostart reload.
Declarative directives
Declarative rules live in ~/.config/anode/autostart (or the file passed via --config FILE). Blank lines and lines starting with # are ignored, and --no-startup-id is accepted for i3 compatibility.
| Directive | Behavior |
|---|---|
exec [--no-startup-id] <command> |
Run <command> once during anode-autostart start |
exec_once [--no-startup-id] <command> |
Run <command> during start only when no matching UID-owned process is already running in the current XDG_SESSION_ID / D-Bus session (checked via POSIX ps and /proc/<pid>/environ when available) |
exec_always [--no-startup-id] <command> |
Run <command> during start and re-run on anode-autostart reload (Mod4 + Shift + r or SIGHUP restart) |
include <path> |
Load directives from another file (absolute path, ~/..., or relative to the current file; duplicate/cyclic includes are skipped, and nesting deeper than 8 levels fails check) |
Note
On Linux (
/proc/<pid>/environ),exec_oncecomparesXDG_SESSION_IDandDBUS_SESSION_BUS_ADDRESSagainst the running session so orphaned background processes left behind by dead or separate login sessions (such aspipewireorredshiftacrosselogindor LightDM logins) do not suppress startup in a fresh ANODE session.
Session profiles
Passing --profile NAME or --profile=NAME to anode-session or anode-autostart (or exporting ANODE_SESSION_PROFILE=NAME) loads ~/.config/anode/autostart.<profile> (or PREFIX/share/anode/autostart.<profile> if no user file exists) immediately after the base autostart file:
# ~/.xinitrc
exec /usr/local/bin/anode-session --profile work
Drop-ins & XDG autostart
During start (never during reload), anode-autostart also evaluates drop-in scripts/desktop files and XDG autostart directories:
- Drop-in directories:
$XDG_CONFIG_HOME/anode/autostart.d/followed by$ANODE_PREFIX/share/anode/autostart.d/. Earlier basenames shadow later ones; regular executable files are executed directly, and*.desktopfiles follow desktop-entry filtering. - XDG autostart directories:
$XDG_CONFIG_HOME/autostart/*.desktopfollowed by each directory in$XDG_CONFIG_DIRS(default/etc/xdg/autostart/*.desktop). Earlier basenames shadow later ones, so placing a.desktopfile withHidden=truein~/.config/autostart/masks the corresponding system entry. - Desktop-entry filtering: Honors
Hidden=true, case-insensitiveOnlyShowIn/NotShowInmatching against$XDG_CURRENT_DESKTOP,TryExecbinary lookup,Terminal=trueexecution viast -e <command>, and stripping of%f/%F/%u/%U/%d/%D/%n/%N/%i/%c/%k/%v/%mfield codes (%%is unescaped to%). - Disabling XDG autostart: Pass
--no-xdgor setANODE_XDG_AUTOSTART=0to skip XDG.desktopdiscovery while keeping declarative configs andautostart.d/drop-ins active.
Command-line usage
Syntax: anode-autostart [start|reload|list|check] [OPTIONS]
| Argument / flag | Behavior |
|---|---|
start |
Default subcommand; run exec, exec_once, exec_always, autostart.d/, and XDG entries |
reload |
Run only exec_always directives (invoked by dwm on Mod4 + Shift + r and SIGHUP restart) |
list |
Print resolved commands and drop-ins without executing them |
check |
Validate declarative configs and include chains (exits 0 on valid, non-zero on error) |
--config FILE / --config=FILE |
Use FILE instead of ~/.config/anode/autostart |
--profile NAME / --profile=NAME |
Load profile overrides from autostart.NAME |
--no-xdg |
Skip $XDG_CONFIG_HOME/autostart and $XDG_CONFIG_DIRS/autostart entries |
--dry-run |
Print [exec], [exec_once], [exec_always], [script], and [desktop] actions without launching |
anode-autostart check
anode-autostart list --profile work
anode-autostart reload --dry-run
Example configuration
# ~/.config/anode/autostart
include ~/.config/anode/local.conf
exec_always --no-startup-id xset r rate 260 35
exec_always --no-startup-id sh -c '[ -r ~/.wallpaper ] && feh --bg-fill ~/.wallpaper'
exec_once --no-startup-id nm-applet
exec_once --no-startup-id picom
exec notify-send "ANODE" "Session ready"