- xdg-desktop-portal
- busctl (systemd)
make install
make install builds the binary, installs all system files, configures portals.conf, and restarts xdg-desktop-portal in one step. PREFIX defaults to /usr; override for non-standard layouts (e.g. make install PREFIX=/usr/local). DESTDIR is supported for staged package builds (portals.conf and systemctl steps are skipped automatically).
Build the release binary, then install files to the following locations (all /usr destinations require root):
| Source | Destination |
|---|---|
target/release/asahi |
/usr/lib/xdg-desktop-portal-asahi |
scripts/asahictl |
/usr/bin/asahictl |
configs/asahi.portal |
/usr/share/xdg-desktop-portal/portals/asahi.portal |
configs/org.freedesktop.impl.portal.desktop.asahi.service |
/usr/share/dbus-1/services/org.freedesktop.impl.portal.desktop.asahi.service |
configs/xdg-desktop-portal-asahi.service |
/usr/lib/systemd/user/xdg-desktop-portal-asahi.service |
Note: The D-Bus
.servicefile and the systemd unit both hardcode the binary path. If your distribution uses a prefix other than/usr(e.g./usr/libexec/), update theExec=/ExecStart=lines in both config files before installing.
Add the following to ~/.config/xdg-desktop-portal/portals.conf under [preferred] (bare keys not belonging to a section are silently ignored):
[preferred]
org.freedesktop.impl.portal.Settings=asahiThen:
systemctl --user daemon-reload
systemctl --user restart xdg-desktop-portal
asahi reads configuration from two locations, merged at startup; the user-local file takes priority over the system-wide one:
| Scope | Path |
|---|---|
| System-wide | /etc/asahi/config.toml |
| User-local | ~/.config/asahi/config.toml |
Both files are optional. A sample config with all available keys and their defaults is provided at configs/config.toml.
| Key | Default | Description |
|---|---|---|
log_level |
info |
Log verbosity (error warn info debug trace) |
override_lat |
(off) | (Optional) Override auto geolocation (must be set together with override_lon) |
override_lon |
(off) | (Optional) Override auto geolocation (must be set together with override_lat) |
location_ttl |
3600 |
Seconds before a location fix is refreshed |
scripts/asahictl queries daemon state and sets manual overrides. Run asahictl --help for usage.
In addition to org.freedesktop.impl.portal.Settings, asahi exposes a custom management interface:
- Destination:
org.freedesktop.impl.portal.desktop.asahi - Object Path:
/org/freedesktop/portal/desktop - Interface:
org.freedesktop.impl.portal.asahi.Control
setManualDarkMode(int32): Sets or clears a manual theme override (-1= Automatic,0= No Preference,1= Dark,2= Light).forceUpdate(): Forces an immediate location refresh, solar recalculation, and theme rebroadcast. No-op when a manual override is active.
currentTheme(u32): Theme currently being broadcast (0= No Preference,1= Dark,2= Light).isOverrideSet(bool): Whether a manual override is active.todayTransitionTimes((string, string)): Today's sunrise and sunset times, formatted asYYYY-MM-DD HH:MM:SS AM/PM. Returns empty strings when a manual override is active.location((double, double)): Coordinates currently used for solar calculations.
Firefox ignores XDG Desktop Portal theme signals, listening only to GNOME's GSettings by default instead.
To fix this, set widget.use-xdg-desktop-portal.settings to 2 in about:config.