mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 00:47:12 +00:00
i3: remove i3/i3-gaps distinction (#3563)
This commit is contained in:
parent
9e565f0d9d
commit
684bdb386c
4 changed files with 43 additions and 32 deletions
|
@ -16,4 +16,8 @@ This release has the following notable changes:
|
||||||
The state version in this release includes the changes below.
|
The state version in this release includes the changes below.
|
||||||
These changes are only active if the `home.stateVersion` option is set to "23.05" or later.
|
These changes are only active if the `home.stateVersion` option is set to "23.05" or later.
|
||||||
|
|
||||||
* No changes.
|
* The <<opt-xsession.windowManager.i3.config.window.titlebar>>,
|
||||||
|
<<opt-xsession.windowManager.i3.config.floating.titlebar>>,
|
||||||
|
<<opt-wayland.windowManager.sway.config.window.titlebar>>,
|
||||||
|
<<opt-wayland.windowManager.sway.config.floating.titlebar>>, options now default to `true` which
|
||||||
|
is consistent with the default values for those options used by `i3` and `sway`.
|
||||||
|
|
|
@ -877,6 +877,15 @@ in
|
||||||
A new module is available: 'services.clipman'.
|
A new module is available: 'services.clipman'.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2023-01-07T10:47:03+00:00";
|
||||||
|
condition = hostPlatform.isLinux;
|
||||||
|
message = ''
|
||||||
|
'xsession.windowManager.i3.config.[window|floating].titlebar' and
|
||||||
|
'wayland.windowManager.sway.config.[window|floating].titlebar' now default to 'true'.
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ let
|
||||||
commonOptions = import ./lib/options.nix {
|
commonOptions = import ./lib/options.nix {
|
||||||
inherit config lib cfg pkgs;
|
inherit config lib cfg pkgs;
|
||||||
moduleName = "i3";
|
moduleName = "i3";
|
||||||
isGaps = cfg.package == pkgs.i3-gaps;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
configModule = types.submodule {
|
configModule = types.submodule {
|
||||||
|
@ -209,16 +208,7 @@ in {
|
||||||
xsession.windowManager.i3 = {
|
xsession.windowManager.i3 = {
|
||||||
enable = mkEnableOption "i3 window manager";
|
enable = mkEnableOption "i3 window manager";
|
||||||
|
|
||||||
package = mkOption {
|
package = mkPackageOption pkgs "i3" { };
|
||||||
type = types.package;
|
|
||||||
default = pkgs.i3;
|
|
||||||
defaultText = literalExpression "pkgs.i3";
|
|
||||||
example = literalExpression "pkgs.i3-gaps";
|
|
||||||
description = ''
|
|
||||||
i3 package to use.
|
|
||||||
If 'i3.config.gaps' settings are specified, 'pkgs.i3-gaps' will be set as a default package.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
type = types.nullOr configModule;
|
type = types.nullOr configModule;
|
||||||
|
@ -260,10 +250,7 @@ in {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf (cfg.config != null) {
|
(mkIf (cfg.config != null) { xsession.windowManager.i3.package = pkgs.i3; })
|
||||||
xsession.windowManager.i3.package =
|
|
||||||
mkDefault (if (cfg.config.gaps != null) then pkgs.i3-gaps else pkgs.i3);
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf (cfg.config != null) {
|
(mkIf (cfg.config != null) {
|
||||||
warnings = (optional (isList cfg.config.fonts)
|
warnings = (optional (isList cfg.config.fonts)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName
|
{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName }:
|
||||||
, isGaps ? true }:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -7,6 +6,8 @@ let
|
||||||
isI3 = moduleName == "i3";
|
isI3 = moduleName == "i3";
|
||||||
isSway = !isI3;
|
isSway = !isI3;
|
||||||
|
|
||||||
|
inherit (config.home) stateVersion;
|
||||||
|
|
||||||
fontOptions = types.submodule {
|
fontOptions = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
names = mkOption {
|
names = mkOption {
|
||||||
|
@ -77,7 +78,7 @@ let
|
||||||
|
|
||||||
barModule = types.submodule {
|
barModule = types.submodule {
|
||||||
options = let
|
options = let
|
||||||
versionAtLeast2009 = versionAtLeast config.home.stateVersion "20.09";
|
versionAtLeast2009 = versionAtLeast stateVersion "20.09";
|
||||||
mkNullableOption = { type, default, ... }@args:
|
mkNullableOption = { type, default, ... }@args:
|
||||||
mkOption (args // {
|
mkOption (args // {
|
||||||
type = types.nullOr type;
|
type = types.nullOr type;
|
||||||
|
@ -158,7 +159,7 @@ let
|
||||||
defaultText = "i3bar";
|
defaultText = "i3bar";
|
||||||
description = "Command that will be used to start a bar.";
|
description = "Command that will be used to start a bar.";
|
||||||
example = if isI3 then
|
example = if isI3 then
|
||||||
"\${pkgs.i3-gaps}/bin/i3bar -t"
|
"\${pkgs.i3}/bin/i3bar -t"
|
||||||
else
|
else
|
||||||
"\${pkgs.waybar}/bin/waybar";
|
"\${pkgs.waybar}/bin/waybar";
|
||||||
};
|
};
|
||||||
|
@ -389,11 +390,17 @@ in {
|
||||||
options = {
|
options = {
|
||||||
titlebar = mkOption {
|
titlebar = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = !isGaps;
|
default = if versionOlder stateVersion "23.05" then
|
||||||
defaultText = if isI3 then
|
(isI3 && (cfg.config.gaps == null))
|
||||||
"xsession.windowManager.i3.package != nixpkgs.i3-gaps (titlebar should be disabled for i3-gaps)"
|
|
||||||
else
|
else
|
||||||
"false";
|
true;
|
||||||
|
defaultText = if isI3 then ''
|
||||||
|
true for state version ≥ 23.05
|
||||||
|
config.gaps == null for state version < 23.05
|
||||||
|
'' else ''
|
||||||
|
true for state version ≥ 23.05
|
||||||
|
false for state version < 23.05
|
||||||
|
'';
|
||||||
description = "Whether to show window titlebars.";
|
description = "Whether to show window titlebars.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -432,11 +439,17 @@ in {
|
||||||
options = {
|
options = {
|
||||||
titlebar = mkOption {
|
titlebar = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = !isGaps;
|
default = if versionOlder stateVersion "23.05" then
|
||||||
defaultText = if isI3 then
|
(isI3 && (cfg.config.gaps == null))
|
||||||
"xsession.windowManager.i3.package != nixpkgs.i3-gaps (titlebar should be disabled for i3-gaps)"
|
|
||||||
else
|
else
|
||||||
"false";
|
true;
|
||||||
|
defaultText = if isI3 then ''
|
||||||
|
true for state version ≥ 23.05
|
||||||
|
config.gaps == null for state version < 23.05
|
||||||
|
'' else ''
|
||||||
|
true for state version ≥ 23.05
|
||||||
|
false for state version < 23.05
|
||||||
|
'';
|
||||||
description = "Whether to show floating window titlebars.";
|
description = "Whether to show floating window titlebars.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -670,7 +683,7 @@ in {
|
||||||
|
|
||||||
bars = mkOption {
|
bars = mkOption {
|
||||||
type = types.listOf barModule;
|
type = types.listOf barModule;
|
||||||
default = if versionAtLeast config.home.stateVersion "20.09" then [{
|
default = if versionAtLeast stateVersion "20.09" then [{
|
||||||
mode = "dock";
|
mode = "dock";
|
||||||
hiddenState = "hide";
|
hiddenState = "hide";
|
||||||
position = "bottom";
|
position = "bottom";
|
||||||
|
@ -826,10 +839,8 @@ in {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
default = null;
|
default = null;
|
||||||
description = if isSway then ''
|
description = ''
|
||||||
Gaps related settings.
|
Gaps related settings.
|
||||||
'' else ''
|
|
||||||
i3Gaps related settings. The i3-gaps package must be used for these features to work.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue