wallpaper: use wpaperd

This commit is contained in:
Sean Kovacs 2026-01-19 14:34:26 -05:00
commit ac2399c9aa
Signed by: sckova
GPG key ID: 00F325187C68651A
3 changed files with 57 additions and 17 deletions

View file

@ -88,14 +88,13 @@
theme = config.userOptions.cursor.name; theme = config.userOptions.cursor.name;
}; };
layout = { layout = {
gaps = 4; gaps = 2;
background-color = pkgs.catppuccin.${config.catppuccin.flavor}.mantle; background-color = pkgs.catppuccin.${config.catppuccin.flavor}.mantle;
default-column-width = { default-column-width = {
proportion = 0.5; proportion = 0.5;
}; };
preset-column-widths = [ preset-column-widths = [
{proportion = 1.0 / 3.0;} {proportion = 1.0 / 3.0;}
{proportion = 1.0 / 2.0;}
{proportion = 2.0 / 3.0;} {proportion = 2.0 / 3.0;}
]; ];
border = { border = {
@ -131,8 +130,8 @@
]; ];
open-floating = true; open-floating = true;
default-floating-position = { default-floating-position = {
x = 32; x = 16;
y = 32; y = 16;
relative-to = "bottom-left"; relative-to = "bottom-left";
}; };
} }

View file

@ -121,8 +121,8 @@
general = { general = {
avatarImage = "/home/${config.userOptions.username}/.face"; avatarImage = "/home/${config.userOptions.username}/.face";
dimmerOpacity = 0.6; dimmerOpacity = 0.6;
showScreenCorners = true; showScreenCorners = false;
forceBlackScreenCorners = true; forceBlackScreenCorners = false;
scaleRatio = 1; scaleRatio = 1;
radiusRatio = 1; radiusRatio = 1;
iRadiusRatio = 1; iRadiusRatio = 1;
@ -356,13 +356,9 @@
criticalUrgencyDuration = 15; criticalUrgencyDuration = 15;
enableKeyboardLayoutToast = true; enableKeyboardLayoutToast = true;
sounds = { sounds = {
enabled = false; enabled = true;
volume = 0.5; volume = 0.5;
separateSounds = false; separateSounds = false;
criticalSoundFile = "";
normalSoundFile = "";
lowSoundFile = "";
excludedApps = "";
}; };
}; };
osd = { osd = {

View file

@ -3,7 +3,7 @@
config, config,
... ...
}: let }: let
bingWallpaperScript = pkgs.writeShellScript "bing-wallpaper" '' script = pkgs.writeShellScript "bing-wallpaper" ''
set -euo pipefail set -euo pipefail
# Configuration # Configuration
@ -63,27 +63,72 @@
echo "Wallpaper downloaded and applied successfully." echo "Wallpaper downloaded and applied successfully."
''; '';
in { in {
home.packages = with pkgs; [
wpaperd
];
home.file.".config/wpaperd/config.toml" = {
text = ''
[default]
mode = "center"
[any]
path = "/home/${config.userOptions.username}/.local/share/wallpaper/daily.jpg"
'';
force = true;
};
systemd.user.services.wpaperd = {
Unit = {
Description = "Modern wallpaper daemon for Wayland";
PartOf = ["niri.service"];
Requires = ["niri.service"];
After = ["niri.service"];
};
Service = {
ExecStart = "${pkgs.wpaperd}/bin/wpaperd";
};
Install = {
WantedBy = [
"niri.service"
];
};
};
systemd.user.services.bing-wallpaper = { systemd.user.services.bing-wallpaper = {
Unit = { Unit = {
Description = "Download and set Bing wallpaper of the day"; Description = "Download and set Bing wallpaper of the day";
After = [ After = [
"network-online.target" "network-online.target"
"niri.service"
"noctalia.service"
]; ];
Wants = [ Wants = [
"network-online.target" "network-online.target"
"noctalia.service"
]; ];
}; };
Service = { Service = {
Type = "oneshot"; Type = "oneshot";
ExecStart = "${bingWallpaperScript}"; ExecStart = "${script}";
ExecStartPost = "${pkgs.systemd}/bin/systemctl --user restart wpaperd.service";
}; };
Install = { Install = {
WantedBy = ["niri.service"]; WantedBy = [
"niri.service"
];
};
};
systemd.user.timers.bing-wallpaper = {
Unit = {
Description = "Run bing wallpaper retrieval daily";
};
Timer = {
OnCalendar = "*-*-* 10:00:00 GMT";
Persistent = true;
};
Install = {
WantedBy = ["timers.target"];
}; };
}; };
} }