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