1 { config, lib, pkgs, ... }:
6 cfg = config.services.xserver.windowManager.bspwm;
11 services.xserver.windowManager.bspwm = {
12 enable = mkEnableOption "bspwm";
14 package = mkPackageOption pkgs "bspwm" {
15 example = "bspwm-unstable";
17 configFile = mkOption {
18 type = with types; nullOr path;
19 example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
22 Path to the bspwm configuration file.
23 If null, $HOME/.config/bspwm/bspwmrc will be used.
28 package = mkPackageOption pkgs "sxhkd" {
29 example = "sxhkd-unstable";
31 configFile = mkOption {
32 type = with types; nullOr path;
33 example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
36 Path to the sxhkd configuration file.
37 If null, $HOME/.config/sxhkd/sxhkdrc will be used.
44 config = mkIf cfg.enable {
45 services.xserver.windowManager.session = singleton {
48 export _JAVA_AWT_WM_NONREPARENTING=1
49 SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\""} &
50 ${cfg.package}/bin/bspwm ${optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
54 environment.systemPackages = [ cfg.package ];
58 (mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
59 "Use services.xserver.windowManager.bspwm.enable and set services.xserver.windowManager.bspwm.package to pkgs.bspwm-unstable to use the unstable version of bspwm.")
60 (mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm" "startThroughSession" ]
61 "bspwm package does not provide bspwm-session anymore.")
62 (mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm" "sessionScript" ]
63 "bspwm package does not provide bspwm-session anymore.")