new wallpaperthingie
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
flakeRoot,
|
||||
user,
|
||||
...
|
||||
@@ -19,31 +18,17 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
home-manager.users.${user.username} = {
|
||||
|
||||
#
|
||||
# ✅ Install wpaperd
|
||||
#
|
||||
home.packages = with pkgs; [
|
||||
wpaperd
|
||||
];
|
||||
|
||||
#
|
||||
# ✅ Ensure config exists
|
||||
#
|
||||
xdg.configFile."wpaperd/config.toml".source = "${sourceDir}/wallpaper.conf";
|
||||
|
||||
#
|
||||
# 🔥 One-time (non-destructive) copy
|
||||
#
|
||||
home.activation.setupWallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
echo "=== Wallpaper setup ==="
|
||||
home.activation.copyWallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
echo "=== Copying wallpapers ==="
|
||||
|
||||
mkdir -p "${targetDir}"
|
||||
|
||||
if [ ! -d "${targetDir}/pictures" ]; then
|
||||
echo "Initializing wallpaper directory..."
|
||||
# Copy ONLY if directory is empty (so user can manage files later)
|
||||
if [ -z "$(ls -A "${targetDir}" 2>/dev/null)" ]; then
|
||||
echo "Directory empty → copying initial files"
|
||||
cp -r ${sourceDir}/* "${targetDir}/"
|
||||
else
|
||||
echo "Wallpaper directory already exists, skipping copy"
|
||||
echo "Directory not empty → skipping copy"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user