Skip to content

Commit

Permalink
xfconf: fix dbus may not be started in the startup of NixOS. (nix-com…
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 authored and 15cm committed Apr 22, 2023
1 parent 31c5aae commit afb4637
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/misc/xfconf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ in {
commands = mapAttrsToList
(channel: properties: mapAttrsToList (mkCommand channel) properties)
cfg.settings;
in concatMapStrings concatStrings commands);

load = pkgs.writeShellScript "load-xfconf"
(concatMapStrings concatStrings commands);
in ''
if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
export DBUS_RUN_SESSION_CMD=""
else
export DBUS_RUN_SESSION_CMD="${pkgs.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon"
fi
$DRY_RUN_CMD $DBUS_RUN_SESSION_CMD ${load}
unset DBUS_RUN_SESSION_CMD
'');
};
}

0 comments on commit afb4637

Please sign in to comment.