create wallpaper dir if missing & fix home dir persistance
This commit is contained in:
parent
7681168109
commit
7d5e5cd6ca
|
@ -13,16 +13,17 @@
|
||||||
WantedBy = [ "default.target" ];
|
WantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
Type = [ "oneshot" ];
|
Type = [ "simple" ];
|
||||||
ExecStart = "${pkgs.writeShellScript "swww-wallpaper-changer" ''
|
ExecStart = "${pkgs.writeShellScript "swww-wallpaper-changer" ''
|
||||||
export WAYLAND_DISPLAY="wayland-1"
|
export WAYLAND_DISPLAY="wayland-1"
|
||||||
wallpaper_dir="$HOME/.local/share/bg/"
|
wallpaper_dir="$HOME/.local/share/bg/"
|
||||||
|
[ -d "$wallpaper_dir" ] || mkdir -p "$wallpaper_dir"
|
||||||
|
|
||||||
# Allow some time for desktop to start
|
# Allow some time for desktop to start
|
||||||
sleep 3
|
sleep 3
|
||||||
echo "starting daemon..."
|
echo "starting daemon..."
|
||||||
${pkgs.swww}/bin/swww-daemon &
|
${pkgs.swww}/bin/swww-daemon &
|
||||||
|
|
||||||
while true; do
|
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
|
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
|
${pkgs.swww}/bin/swww img "$file" --transition-step 10 --transition-fps 60
|
||||||
|
|
|
@ -50,12 +50,9 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.persistence."/persist" = {
|
environment.persistence."/persist" = {
|
||||||
hideMounts = true;
|
directories = [
|
||||||
users.${username} = {
|
"/home/${username}"
|
||||||
directories = [
|
];
|
||||||
"."
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue