new wallpaperthingie

This commit is contained in:
2026-03-17 18:54:15 +00:00
parent bd2824a904
commit cd70d828d3
@@ -2,42 +2,45 @@
config, config,
pkgs, pkgs,
lib, lib,
flakeRoot,
... ...
}: }:
let let
wallpaperSource = "${flakeRoot}/assets/hyprland/wallpaperstuff"; wallpaperSource = "${config.home.homeDirectory}/.config/wpaperd-source"; # or flakeRoot path
wallpaperTarget = "$HOME/.config/wpaperd"; wallpaperTarget = "${config.home.homeDirectory}/.config/wpaperd";
in in
{ {
# Install wpaperd system-wide home.packages = [ pkgs.wpaperd ];
environment.systemPackages = with pkgs; [ wpaperd ];
# Activation script: copy wallpapers & config to ~/.config/wpaperd home.file.".config/wpaperd/wallpaper.conf".source = "${wallpaperSource}/wallpaper.conf";
system.activationScripts.copyWpaperdConfig = {
home.activation.copyWpaperd = lib.homeManager.activationScript {
name = "copy-wpaperd";
text = '' text = ''
echo "=== Copying wpaperd config to $HOME/.config/wpaperd ===" echo "=== Copying wpaperd source to ${wallpaperTarget} ==="
mkdir -p "${wallpaperTarget}" mkdir -p "${wallpaperTarget}"
cp -rT "${wallpaperSource}" "${wallpaperTarget}" cp -rT "${wallpaperSource}" "${wallpaperTarget}"
echo "Done." echo "Done."
''; '';
deps = [ ];
}; };
# User systemd service (runs on login) home.sessionVariables = {
systemd.user.services.wpaperd = { WPAPERD_CONFIG = "${wallpaperTarget}/wallpaper.conf";
description = "wpaperd wallpaper daemon";
after = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "bash -c '${pkgs.wpaperd}/bin/wpaperd --config ${wallpaperTarget}/wallpaper.conf'";
Restart = "on-failure";
RestartSec = 1;
};
wantedBy = [ "default.target" ];
enable = true;
}; };
# User-level service
home.file.".config/systemd/user/wpaperd.service".text = ''
[Unit]
Description=wpaperd wallpaper daemon
After=default.target
[Service]
Type=simple
ExecStart=${pkgs.wpaperd}/bin/wpaperd --config ${wallpaperTarget}/wallpaper.conf
Restart=on-failure
RestartSec=1
[Install]
WantedBy=default.target
'';
} }