i3 & xfce modules: add extraSessionCommands for WM-specific user-defined xsession lines
Could be extended to other window managers/desktops as well
commit0243ccfbffaffa8cac669f5b80c28ee4bb5334e6
authorobadz <obadz-git@obadz.com>
dateSun 19 Jun 2016, 23:50 (10 years ago)
parent6e0b40a
nixos/modules/services/x11/desktop-managers/xfce.nix+10
@@ -33,6 +33,14 @@ in
3333 default = false;
3434 description = "Don't install XFCE desktop components (xfdesktop, panel and notification daemon).";
3535 };
36+
37+ extraSessionCommands = mkOption {
38+ default = "";
39+ type = types.lines;
40+ description = ''
41+ Shell commands executed just before XFCE is started.
42+ '';
43+ };
3644 };
3745
3846 };
@@ -45,6 +53,8 @@ in
4553 bgSupport = true;
4654 start =
4755 ''
56+ ${cfg.extraSessionCommands}
57+
4858 # Set GTK_PATH so that GTK+ can find the theme engines.
4959 export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
5060
nixos/modules/services/x11/window-managers/i3.nix+9
@@ -15,12 +15,21 @@ let
1515 If left at the default value, $HOME/.i3/config will be used.
1616 '';
1717 };
18+ extraSessionCommands = mkOption {
19+ default = "";
20+ type = types.lines;
21+ description = ''
22+ Shell commands executed just before i3 is started.
23+ '';
24+ };
1825 };
1926
2027 i3config = name: pkg: cfg: {
2128 services.xserver.windowManager.session = [{
2229 inherit name;
2330 start = ''
31+ ${cfg.extraSessionCommands}
32+
2433 ${pkg}/bin/i3 ${optionalString (cfg.configFile != null)
2534 "-c \"${cfg.configFile}\""
2635 } &