git.iko.soy/typeable/nixpkgs
on master help sign in
bspwm: add startThroughSession & sessionScript option

Add ability to do a more traditional bspwm startup (using the bspwm-session script provided by nixpkgs.bspwm) as an alternative to directly starting sxhkd & bspwm Also added the ability to specify a custom startup script, instead of relying on the provided bspwm-session

commite50da7ee6a44fcdb846139b2b902c202959c5f61 authorMaxwell <mhuan13@gmail.com> dateSat 30 Jan 2016, 21:09 (11 years ago) parent183ac3f
1 file changed+28−5
nixos/modules/services/x11/window-managers/bspwm.nix+28−5
nixos/modules/services/x11/window-managers/bspwm.nix+28−5
@@ -8,16 +8,39 @@ in
88
99{
1010 options = {
11− services.xserver.windowManager.bspwm.enable = mkEnableOption "bspwm";
11+ services.xserver.windowManager.bspwm = {
12+ enable = mkEnableOption "bspwm";
13+ startThroughSession = mkOption {
14+ type = with types; bool;
15+ default = false;
16+ description = "
17+ Start the window manager through the script defined in
18+ sessionScript. Defaults to the the bspwm-session script
19+ provided by bspwm
20+ ";
21+ };
22+ sessionScript = mkOption {
23+ default = "${pkgs.bspwm}/bin/bspwm-session";
24+ defaultText = "(pkgs.bspwm)/bin/bspwm-session";
25+ description = "
26+ The start-session script to use. Defaults to the
27+ provided bspwm-session script from the bspwm package.
28+
29+ Does nothing unless `bspwm.startThroughSession` is enabled
30+ ";
31+ };
32+ };
1233 };
1334
1435 config = mkIf cfg.enable {
1536 services.xserver.windowManager.session = singleton {
1637 name = "bspwm";
17− start = "
18− SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
19− ${pkgs.bspwm}/bin/bspwm
20− ";
38+ start = if cfg.startThroughSession
39+ then cfg.sessionScript
40+ else ''
41+ SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
42+ ${pkgs.bspwm}/bin/bspwm
43+ '';
2144 };
2245 environment.systemPackages = [ pkgs.bspwm ];
2346 };