fix niri
This commit is contained in:
parent
db11846811
commit
67c2117563
16 changed files with 652 additions and 274 deletions
38
modules/desktop/wpaperd.nix
Normal file
38
modules/desktop/wpaperd.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.xyno.desktop.wpaperd;
|
||||
wpaperdConf = pkgs.writeText "wpaperd.conf" ''
|
||||
[default]
|
||||
path = "/home/${config.xyno.system.user.name}/Pictures/backgrounds"
|
||||
duration = "10m"
|
||||
sorting = "random"
|
||||
mode = "center"
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.xyno.desktop.wpaperd.enable = lib.mkEnableOption "enable wpaperd notification daemon";
|
||||
options.xyno.desktop.wpaperd.wantedBy = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "niri.service";
|
||||
};
|
||||
options.xyno.desktop.wpaperd.package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.wpaperd;
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.user.services.wpaperd = {
|
||||
unitConfig.PartOf = "graphical-session.target";
|
||||
unitConfig.After = "graphical-session.target";
|
||||
unitConfig.Requisite = "graphical-session.target";
|
||||
serviceConfig.Restart = "on-failure";
|
||||
wantedBy = [ cfg.wantedBy ];
|
||||
script = "${cfg.package}/bin/wpaperd -c ${wpaperdConf}";
|
||||
restartTriggers = [wpaperdConf];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue