2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.windowManager.bspwm;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.xserver.windowManager.bspwm = {
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "bspwm");
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "bspwm" {
|
|
|
|
example = "bspwm-unstable";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
configFile = mkOption {
|
|
|
|
type = with types; nullOr path;
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/bspwmrc"'';
|
2020-04-24 23:36:52 +00:00
|
|
|
default = null;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Path to the bspwm configuration file.
|
|
|
|
If null, $HOME/.config/bspwm/bspwmrc will be used.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
sxhkd = {
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "sxhkd" {
|
|
|
|
example = "sxhkd-unstable";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
configFile = mkOption {
|
|
|
|
type = with types; nullOr path;
|
2021-10-06 13:57:05 +00:00
|
|
|
example = literalExpression ''"''${pkgs.bspwm}/share/doc/bspwm/examples/sxhkdrc"'';
|
2020-04-24 23:36:52 +00:00
|
|
|
default = null;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Path to the sxhkd configuration file.
|
|
|
|
If null, $HOME/.config/sxhkd/sxhkdrc will be used.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.xserver.windowManager.session = singleton {
|
|
|
|
name = "bspwm";
|
|
|
|
start = ''
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${optionalString (cfg.sxhkd.configFile != null) "-c \"${cfg.sxhkd.configFile}\""} &
|
|
|
|
${cfg.package}/bin/bspwm ${optionalString (cfg.configFile != null) "-c \"${cfg.configFile}\""} &
|
|
|
|
waitPID=$!
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
};
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm-unstable" "enable" ]
|
|
|
|
"Use services.xserver.windowManager.bspwm.enable and set services.xserver.windowManager.bspwm.package to pkgs.bspwm-unstable to use the unstable version of bspwm.")
|
|
|
|
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm" "startThroughSession" ]
|
|
|
|
"bspwm package does not provide bspwm-session anymore.")
|
|
|
|
(mkRemovedOptionModule [ "services" "xserver" "windowManager" "bspwm" "sessionScript" ]
|
|
|
|
"bspwm package does not provide bspwm-session anymore.")
|
|
|
|
];
|
|
|
|
}
|