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
This commit is contained in:
parent
183ac3f2c4
commit
e50da7ee6a
@ -8,16 +8,39 @@ in
|
|||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
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 {
|
config = mkIf cfg.enable {
|
||||||
services.xserver.windowManager.session = singleton {
|
services.xserver.windowManager.session = singleton {
|
||||||
name = "bspwm";
|
name = "bspwm";
|
||||||
start = "
|
start = if cfg.startThroughSession
|
||||||
|
then cfg.sessionScript
|
||||||
|
else ''
|
||||||
SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
|
SXHKD_SHELL=/bin/sh ${pkgs.sxhkd}/bin/sxhkd -f 100 &
|
||||||
${pkgs.bspwm}/bin/bspwm
|
${pkgs.bspwm}/bin/bspwm
|
||||||
";
|
'';
|
||||||
};
|
};
|
||||||
environment.systemPackages = [ pkgs.bspwm ];
|
environment.systemPackages = [ pkgs.bspwm ];
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user