mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
swayosd: Remove non-existing display arg option (#7752)
This commit is contained in:
parent
30fc1b5326
commit
6159629d05
4 changed files with 60 additions and 12 deletions
|
|
@ -18,6 +18,14 @@ in
|
||||||
{
|
{
|
||||||
meta.maintainers = [ lib.hm.maintainers.pltanton ];
|
meta.maintainers = [ lib.hm.maintainers.pltanton ];
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(lib.mkRemovedOptionModule [
|
||||||
|
"services"
|
||||||
|
"swayosd"
|
||||||
|
"display"
|
||||||
|
] "The --display flag is no longer available in swayosd-server.")
|
||||||
|
];
|
||||||
|
|
||||||
options.services.swayosd = {
|
options.services.swayosd = {
|
||||||
enable = lib.mkEnableOption ''
|
enable = lib.mkEnableOption ''
|
||||||
swayosd, a GTK based on screen display for keyboard shortcuts like
|
swayosd, a GTK based on screen display for keyboard shortcuts like
|
||||||
|
|
@ -45,15 +53,6 @@ in
|
||||||
Use a custom Stylesheet file instead of looking for one.
|
Use a custom Stylesheet file instead of looking for one.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
display = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
example = "eDP-1";
|
|
||||||
description = ''
|
|
||||||
X display to use.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -79,7 +78,6 @@ in
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
ExecStart =
|
ExecStart =
|
||||||
"${cfg.package}/bin/swayosd-server"
|
"${cfg.package}/bin/swayosd-server"
|
||||||
+ (optionalString (cfg.display != null) " --display ${cfg.display}")
|
|
||||||
+ (optionalString (cfg.stylePath != null) " --style ${lib.escapeShellArg cfg.stylePath}")
|
+ (optionalString (cfg.stylePath != null) " --style ${lib.escapeShellArg cfg.stylePath}")
|
||||||
+ (optionalString (cfg.topMargin != null) " --top-margin ${toString cfg.topMargin}");
|
+ (optionalString (cfg.topMargin != null) " --top-margin ${toString cfg.topMargin}");
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||||
swayosd = ./swayosd.nix;
|
swayosd = ./swayosd.nix;
|
||||||
|
swayosd-with-deprecated-options = ./deprecated-options.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
50
tests/modules/services/swayosd/deprecated-options.nix
Normal file
50
tests/modules/services/swayosd/deprecated-options.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.swayosd = {
|
||||||
|
enable = true;
|
||||||
|
package = config.lib.test.mkStubPackage {
|
||||||
|
name = "swayosd";
|
||||||
|
outPath = "@swayosd@";
|
||||||
|
};
|
||||||
|
display = "DISPLAY";
|
||||||
|
stylePath = "/etc/xdg/swayosd/style.css";
|
||||||
|
topMargin = 0.1;
|
||||||
|
};
|
||||||
|
|
||||||
|
test.asserts.assertions.expected = [
|
||||||
|
''
|
||||||
|
The option definition `services.swayosd.display' in ${lib.showFiles options.services.swayosd.display.files} no longer has any effect; please remove it.
|
||||||
|
The --display flag is no longer available in swayosd-server.
|
||||||
|
''
|
||||||
|
];
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.config/systemd/user/swayosd.service \
|
||||||
|
${builtins.toFile "swayosd.service" ''
|
||||||
|
[Install]
|
||||||
|
WantedBy=graphical-session.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=@swayosd@/bin/swayosd-server --style /etc/xdg/swayosd/style.css --top-margin 0.100000
|
||||||
|
Restart=always
|
||||||
|
RestartSec=2s
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
After=graphical-session.target
|
||||||
|
ConditionEnvironment=WAYLAND_DISPLAY
|
||||||
|
Description=Volume/backlight OSD indicator
|
||||||
|
Documentation=man:swayosd(1)
|
||||||
|
PartOf=graphical-session.target
|
||||||
|
StartLimitBurst=5
|
||||||
|
StartLimitIntervalSec=10
|
||||||
|
''}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
name = "swayosd";
|
name = "swayosd";
|
||||||
outPath = "@swayosd@";
|
outPath = "@swayosd@";
|
||||||
};
|
};
|
||||||
display = "DISPLAY";
|
|
||||||
stylePath = "/etc/xdg/swayosd/style.css";
|
stylePath = "/etc/xdg/swayosd/style.css";
|
||||||
topMargin = 0.1;
|
topMargin = 0.1;
|
||||||
};
|
};
|
||||||
|
|
@ -20,7 +19,7 @@
|
||||||
WantedBy=graphical-session.target
|
WantedBy=graphical-session.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --style /etc/xdg/swayosd/style.css --top-margin 0.100000
|
ExecStart=@swayosd@/bin/swayosd-server --style /etc/xdg/swayosd/style.css --top-margin 0.100000
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=2s
|
RestartSec=2s
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue