2014-08-09 22:31:05 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.windowManager.bspwm;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
2016-01-31 02:09:37 +00:00
|
|
|
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
|
|
|
|
";
|
|
|
|
};
|
|
|
|
};
|
2014-08-09 22:31:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.xserver.windowManager.session = singleton {
|
|
|
|
name = "bspwm";
|
2016-01-31 02:09:37 +00:00
|
|
|
start = if cfg.startThroughSession
|
|
|
|
then cfg.sessionScript
|
|
|
|
else ''
|
2016-05-03 22:39:18 +01:00
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
2016-01-31 02:09:37 +00:00
|
|
|
SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
|
|
|
|
${pkgs.bspwm}/bin/bspwm
|
|
|
|
'';
|
2014-08-09 22:31:05 +01:00
|
|
|
};
|
|
|
|
environment.systemPackages = [ pkgs.bspwm ];
|
|
|
|
};
|
|
|
|
}
|