i3 & xfce modules: add extraSessionCommands for WM-specific user-defined xsession lines

Could be extended to other window managers/desktops as well

obadz 0243ccfb 6e0b40af

Changed files
+19
nixos
modules
services
x11
desktop-managers
window-managers
+10
nixos/modules/services/x11/desktop-managers/xfce.nix
···
default = false;
description = "Don't install XFCE desktop components (xfdesktop, panel and notification daemon).";
};
+
+
extraSessionCommands = mkOption {
+
default = "";
+
type = types.lines;
+
description = ''
+
Shell commands executed just before XFCE is started.
+
'';
+
};
};
};
···
bgSupport = true;
start =
''
+
${cfg.extraSessionCommands}
+
# Set GTK_PATH so that GTK+ can find the theme engines.
export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
+9
nixos/modules/services/x11/window-managers/i3.nix
···
If left at the default value, $HOME/.i3/config will be used.
'';
};
+
extraSessionCommands = mkOption {
+
default = "";
+
type = types.lines;
+
description = ''
+
Shell commands executed just before i3 is started.
+
'';
+
};
};
i3config = name: pkg: cfg: {
services.xserver.windowManager.session = [{
inherit name;
start = ''
+
${cfg.extraSessionCommands}
+
${pkg}/bin/i3 ${optionalString (cfg.configFile != null)
"-c \"${cfg.configFile}\""
} &