From 1e8d0beae47ab7001d2ae10f738b566f8622d1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Thu, 10 Jun 2021 11:56:41 +0200 Subject: [PATCH] xresources: load .Xresources in xsession.initExtra --- modules/xresources.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/xresources.nix b/modules/xresources.nix index dc59e50c..8a7e6321 100644 --- a/modules/xresources.nix +++ b/modules/xresources.nix @@ -23,6 +23,8 @@ let toString v; in "${n}: ${formatValue v}"; + xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; + in { meta.maintainers = [ maintainers.rycee ]; @@ -45,7 +47,7 @@ in { X server resources that should be set. Booleans are formatted as "true" or "false" respectively. List elements are recursively formatted as a string and joined by commas. - All other values are directly formatted using builtins.toString. + All other values are directly formatted using builtins.toString. Note, that 2-dimensional lists are not supported and specifying one will throw an exception. If this and all other xresources options are null, then this feature is disabled and no @@ -84,9 +86,11 @@ in { (mapAttrsToList formatLine cfg.properties)) + "\n"; onChange = '' if [[ -v DISPLAY ]] ; then - $DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources + $DRY_RUN_CMD ${xrdbMerge} fi ''; }; + + xsession.initExtra = xrdbMerge; }; }