mirror of
https://github.com/nix-community/home-manager
synced 2024-11-11 05:39:44 +01:00
swayosd: update executable
This commit is contained in:
parent
e910311c46
commit
875fa16fe2
2 changed files with 21 additions and 9 deletions
|
@ -16,12 +16,22 @@ in {
|
||||||
|
|
||||||
package = mkPackageOption pkgs "swayosd" { };
|
package = mkPackageOption pkgs "swayosd" { };
|
||||||
|
|
||||||
maxVolume = mkOption {
|
topMargin = mkOption {
|
||||||
type = types.nullOr types.ints.unsigned;
|
type = types.nullOr (types.addCheck types.float (f: f >= 0.0 && f <= 1.0)
|
||||||
|
// {
|
||||||
|
description = "float between 0.0 and 1.0 (inclusive)";
|
||||||
|
});
|
||||||
default = null;
|
default = null;
|
||||||
example = 120;
|
example = 1.0;
|
||||||
|
description = "OSD margin from top edge (0.5 would be screen center).";
|
||||||
|
};
|
||||||
|
|
||||||
|
display = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
example = "eDP-1";
|
||||||
description = ''
|
description = ''
|
||||||
Sets the maximum volume.
|
X display to use.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -45,9 +55,10 @@ in {
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
ExecStart = "${cfg.package}/bin/swayosd"
|
ExecStart = "${cfg.package}/bin/swayosd-server"
|
||||||
+ (optionalString (cfg.maxVolume != null)
|
+ (optionalString (cfg.display != null) " --display ${cfg.display}")
|
||||||
" --max-volume ${toString cfg.maxVolume}");
|
+ (optionalString (cfg.topMargin != null)
|
||||||
|
" --top-margin ${toString cfg.topMargin}");
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
name = "swayosd";
|
name = "swayosd";
|
||||||
outPath = "@swayosd@";
|
outPath = "@swayosd@";
|
||||||
};
|
};
|
||||||
maxVolume = 10;
|
display = "DISPLAY";
|
||||||
|
topMargin = 0.1;
|
||||||
};
|
};
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
WantedBy=graphical-session.target
|
WantedBy=graphical-session.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@swayosd@/bin/swayosd --max-volume 10
|
ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --top-margin 0.100000
|
||||||
Restart=always
|
Restart=always
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue