Fix scheduled or remote theme switching (darkman, systemd timer, ssh)
The cause holds on 4.0.4-1. omarchy-theme-set sets OMARCHY_THEMES_PATH="$OMARCHY_PATH/themes" and prints Theme '<name>' does not exist. /usr/bin/omarchy never sets OMARCHY_PATH (grep finds no reference). omarchy-theme-set-templates takes TEMPLATES_DIR from $OMARCHY_PATH/default/themed. env-bootstrap lists /etc/profile.d/omarchy.sh, /etc/skel/.bashrc and uwsm env.d as its sources. omarchy-theme-set-gnome exits 0 when DBUS_SESSION_BUS_ADDRESS is empty. The absence of OMARCHY_PATH in a non-interactive ssh on 4.0.4-1 comes from this repo's own check on test1 dated 2026-09-19 and was not repeated here. darkman's contrib/darkman.service is Type=dbus with WantedBy=default.target. darkman.1 documents executables in $XDG_DATA_HOME/darkman that take dark or light as $1 and need the executable bit, and darkman.conf.5 documents lat and lng. darkman 2.3.1-1 is in extra. Two defects. The 'plain systemd timer' section gave only a service, with no timer unit and no enable command, so following it schedules nothing. The corrected fix adds the timer and makes the service Requisite on graphical-session.target, so a run with no session is skipped. Issue #2911 is a closed Omarchy 3 feature suggestion for a theme rotator and says nothing about OMARCHY_PATH, ssh or GTK, so it is removed. Not exercised: installing darkman or starting any unit, because this is the operator's workstation.
Install darkman with sudo pacman -S darkman only after omarchy update. Never use pacman -Sy darkman, which is a partial upgrade.
Symptom
Automatic light/dark switching does not work. A darkman script, a systemd timer or ssh box omarchy theme set tokyo-night prints Theme 'tokyo-night' does not exist for a stock theme that is plainly installed. Or a user theme half-applies: the terminals break or keep old colours. Or the theme changes but GTK apps (Nautilus, GNOME Text Editor) stay in the old light or dark mode. Running the same command in a terminal on the desktop works.
Cause
omarchy-theme-set builds the stock theme path as OMARCHY_THEMES_PATH="$OMARCHY_PATH/themes", and the omarchy dispatcher does not set OMARCHY_PATH. The variable comes from /usr/share/omarchy/default/bash/env-bootstrap, which is sourced by login shells (/etc/profile.d/omarchy.sh), by interactive bash, and by the uwsm graphical session. A non-interactive ssh host cmd on 4.0.4 does not have it, and neither does a service started before the session environment is imported. With the variable empty, a stock theme resolves to /themes/<name> and is reported missing. A user theme gets past that check, but the stock files and $OMARCHY_PATH/default/themed templates are not found, so its generated configs are incomplete.
Second, omarchy-theme-set-gnome exits 0 without doing anything when DBUS_SESSION_BUS_ADDRESS is unset, so the color-scheme and gtk-theme change is skipped without a message. The post-theme steps themselves run under bash -lc, so they do get OMARCHY_PATH. The failure is in the main script. darkman's packaged unit is WantedBy=default.target, so it starts with the user manager, possibly before Hyprland has imported its environment, and its first transition at login runs scripts with that bare environment.
Fix
Always call it through a login shell, so env-bootstrap sets OMARCHY_PATH:
ssh <host> 'bash -lc "omarchy theme set tokyo-night"'
**darkman (sunset and sunrise switching).** Install it, set a location, and add a script. darkman runs executables in ~/.local/share/darkman/ with dark or light as the argument, and they must have the executable bit:
sudo pacman -S darkman
mkdir -p ~/.config/darkman ~/.local/share/darkman
printf 'lat: 52\nlng: 5\n' > ~/.config/darkman/config.yaml # replace with your own rounded location
cat > ~/.local/share/darkman/omarchy-theme.sh <<'EOF'
#!/bin/bash
case "$1" in
dark) theme=tokyo-night ;;
light) theme=catppuccin-latte ;;
*) exit 0 ;;
esac
exec bash -lc "omarchy theme set $theme"
EOF
chmod +x ~/.local/share/darkman/omarchy-theme.sh
Tie it to the graphical session rather than default.target, so it starts after Hyprland has exported its environment and stops at logout:
mkdir -p ~/.config/systemd/user/darkman.service.d
cat > ~/.config/systemd/user/darkman.service.d/omarchy.conf <<'EOF'
[Unit]
After=graphical-session.target
PartOf=graphical-session.target
EOF
systemctl --user daemon-reload
systemctl --user disable darkman.service
systemctl --user add-wants graphical-session.target darkman.service
systemctl --user restart darkman.service
**A plain systemd timer.** Use the same login-shell form in the service, require a running graphical session, and add a timer that triggers it:
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/theme-dark.service <<'EOF'
[Unit]
Description=Switch Omarchy to the dark theme
After=graphical-session.target
Requisite=graphical-session.target
[Service]
Type=oneshot
ExecStart=/bin/bash -lc 'omarchy theme set tokyo-night'
EOF
cat > ~/.config/systemd/user/theme-dark.timer <<'EOF'
[Unit]
Description=Switch Omarchy to the dark theme in the evening
[Timer]
OnCalendar=*-*-* 19:00
[Install]
WantedBy=timers.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now theme-dark.timer
systemctl --user list-timers theme-dark.timer
Copy both files as theme-light.service and theme-light.timer with a light theme and a morning time for the other direction.
If GTK apps still do not switch, check that the caller has a session bus: bash -lc 'echo $DBUS_SESSION_BUS_ADDRESS' must print a path.
Verify
darkman set light (or systemctl --user start theme-dark.service) switches the desktop. gsettings get org.gnome.desktop.interface color-scheme follows ('prefer-light' or 'prefer-dark'), and journalctl --user -u darkman -n 20 shows no does not exist line.
Sources
- https://github.com/omacom/omarchy/blob/quattro/bin/omarchy-theme-set
- https://github.com/omacom/omarchy/blob/quattro/bin/omarchy-theme-set-gnome
- https://github.com/omacom/omarchy/blob/quattro/default/bash/env-bootstrap
- https://gitlab.com/WhyNotHugo/darkman
- https://gitlab.com/WhyNotHugo/darkman/-/blob/main/darkman.1
- https://gitlab.com/WhyNotHugo/darkman/-/blob/main/darkman.conf.5
- https://gitlab.com/WhyNotHugo/darkman/-/blob/main/contrib/darkman.service
- https://wiki.archlinux.org/title/Dark_mode_switching