summary refs log tree commit diff
path: root/nixos/modules/services/x11/window-managers/bspwm.nix
diff options
context:
space:
mode:
authorMaxwell <mhuan13@gmail.com>2016-01-30 21:09:37 -0500
committerMaxwell <mhuan13@gmail.com>2016-03-01 17:29:15 -0500
commite50da7ee6a44fcdb846139b2b902c202959c5f61 (patch)
tree84e4c5cae2a40b36100af7931083d47083fe84e7 /nixos/modules/services/x11/window-managers/bspwm.nix
parent183ac3f2c4daa711d7e44ca6c043dc24ab27f579 (diff)
downloadnixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.tar
nixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.tar.gz
nixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.tar.bz2
nixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.tar.lz
nixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.tar.xz
nixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.tar.zst
nixpkgs-e50da7ee6a44fcdb846139b2b902c202959c5f61.zip
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
Diffstat (limited to 'nixos/modules/services/x11/window-managers/bspwm.nix')
-rw-r--r--nixos/modules/services/x11/window-managers/bspwm.nix33
1 files changed, 28 insertions, 5 deletions
diff --git a/nixos/modules/services/x11/window-managers/bspwm.nix b/nixos/modules/services/x11/window-managers/bspwm.nix
index 1edf6ba4deb..271b1b6cf5d 100644
--- a/nixos/modules/services/x11/window-managers/bspwm.nix
+++ b/nixos/modules/services/x11/window-managers/bspwm.nix
@@ -8,16 +8,39 @@ in
 
 {
   options = {
-    services.xserver.windowManager.bspwm.enable = mkEnableOption "bspwm";
+    services.xserver.windowManager.bspwm = {
+        enable = mkEnableOption "bspwm";
+        startThroughSession = mkOption {
+            type = with types; bool;
+            default = false;
+            description = "
+                Start the window manager through the script defined in 
+                sessionScript. Defaults to the the bspwm-session script
+                provided by bspwm
+            ";
+        };
+        sessionScript = mkOption {
+            default = "${pkgs.bspwm}/bin/bspwm-session";
+            defaultText = "(pkgs.bspwm)/bin/bspwm-session";
+            description = "
+                The start-session script to use. Defaults to the
+                provided bspwm-session script from the bspwm package.
+
+                Does nothing unless `bspwm.startThroughSession` is enabled
+            ";
+        };
+    };
   };
 
   config = mkIf cfg.enable {
     services.xserver.windowManager.session = singleton {
       name = "bspwm";
-      start = "
-        SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
-        ${pkgs.bspwm}/bin/bspwm
-      ";
+      start = if cfg.startThroughSession
+        then cfg.sessionScript
+        else ''
+            SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
+            ${pkgs.bspwm}/bin/bspwm
+        '';
     };
     environment.systemPackages = [ pkgs.bspwm ];
   };