From 7d5e5cd6cadadc1b07c5793542e3ccac75e91024 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 1 Jun 2024 15:42:59 +0100 Subject: [PATCH] create wallpaper dir if missing & fix home dir persistance --- .../wallpaper-changer/swww-wallpaper-changer/default.nix | 7 ++++--- hosts/common/users/sam/default.nix | 9 +++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix b/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix index 3ca13d1..d0b135f 100644 --- a/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix +++ b/home/common/optional/desktop/wallpaper-changer/swww-wallpaper-changer/default.nix @@ -13,16 +13,17 @@ WantedBy = [ "default.target" ]; }; Service = { - Type = [ "oneshot" ]; + Type = [ "simple" ]; ExecStart = "${pkgs.writeShellScript "swww-wallpaper-changer" '' export WAYLAND_DISPLAY="wayland-1" wallpaper_dir="$HOME/.local/share/bg/" - + [ -d "$wallpaper_dir" ] || mkdir -p "$wallpaper_dir" + # Allow some time for desktop to start sleep 3 echo "starting daemon..." ${pkgs.swww}/bin/swww-daemon & - + while true; do find "$wallpaper_dir" -type f -follow \( -iname \*.jpg -o -iname \*.png -o -iname \*.gif -o -iname \*.bmp \) | shuf | while read -r file; do ${pkgs.swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60 diff --git a/hosts/common/users/sam/default.nix b/hosts/common/users/sam/default.nix index 90e93ef..0548e85 100644 --- a/hosts/common/users/sam/default.nix +++ b/hosts/common/users/sam/default.nix @@ -50,12 +50,9 @@ in ''; environment.persistence."/persist" = { - hideMounts = true; - users.${username} = { - directories = [ - "." - ]; - }; + directories = [ + "/home/${username}" + ]; };