From fe2ab66cfbb36984b2a37f5add7402740730ffce Mon Sep 17 00:00:00 2001 From: "info@data-pro.nu" Date: Tue, 17 Mar 2026 16:25:30 +0000 Subject: [PATCH] new wallpaperthingie --- Droidnix/README.org | 54 ++++++++++--------- .../decorations/rotating_wallpaper.nix | 53 +++++++++--------- 2 files changed, 58 insertions(+), 49 deletions(-) diff --git a/Droidnix/README.org b/Droidnix/README.org index d84866814..a51063849 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -784,10 +784,35 @@ Finally, it creates a systemd user service (wpaperd.service) that automatically let # Define source and destination paths - script_path = "${flakeRoot}/assets/hyprland/scripts"; source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff"; destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff"; wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf"; + + # Define the script in the let block + copy_wallpapers_script = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + # Source and destination directories + SOURCE_DIR="${source_path}" + DEST_DIR="${destination_path}" + # Check if source directory exists + if [ ! -d "$SOURCE_DIR" ]; then + echo "Error: Source directory $SOURCE_DIR does not exist." + exit 1 + fi + # Create destination directory if it doesn't exist + mkdir -p "$DEST_DIR" + # Use rsync to copy files, overwriting symlinks and existing files + rsync -av --no-group --no-owner "$SOURCE_DIR/" "$DEST_DIR/" + echo "Config files copied from $SOURCE_DIR to $DEST_DIR. Symlinks replaced with editable files." + ''; + + # Print the script contents during the build + _ = builtins.trace (lib.concatStringsSep "\n" [ + "=== Contents of copy-wallpapers.sh ===" + copy_wallpapers_script + "=== End of copy-wallpapers.sh ===" + ]); in { options = { wallpaper.enable = lib.mkEnableOption "Wallpaper setup"; @@ -795,32 +820,12 @@ in { config = lib.mkIf config.wallpaper.enable { # Use a script to copy all files from source to destination - home-manager.users.${config.home.username}.home.file."${script_path}/copy-wallpapers.sh".text = '' - #!${pkgs.bash}/bin/bash - set -euo pipefail - # Source and destination directories - SOURCE_DIR="${source_path}" - DEST_DIR="${destination_path}" - # Print script contents for debugging - echo "=== Script Contents ===" - cat "$0" - echo "=== End of Script Contents ===" - # Check if source directory exists - if [ ! -d "$SOURCE_DIR" ]; then - echo "Error: Source directory $SOURCE_DIR does not exist." - exit 1 - fi - # Create destination directory if it doesn't exist - mkdir -p "$DEST_DIR" - # Use rsync to copy files, overwriting symlinks and existing files - rsync -av --no-group --no-owner "$SOURCE_DIR/" "$DEST_DIR/" - echo "Config files copied from $SOURCE_DIR to $DEST_DIR. Symlinks replaced with editable files." - ''; - home-manager.users.${config.home.username}.home.file."${script_path}/copy-wallpapers.sh".executable = true; + home-manager.users.${config.home.username}.home.file."${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh".text = copy_wallpapers_script; + home-manager.users.${config.home.username}.home.file."${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh".executable = true; # Run the script on activation home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = '' - "${script_path}/copy-wallpapers.sh" + "${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh" ''; # Install wpaperd @@ -830,7 +835,6 @@ in { home-manager.users.${config.home.username}.home.file."${config.home.homeDirectory}/.config/wpaperd/config.toml".text = builtins.readFile wallpaper_conf; }; } - #+END_SRC ** =generated/hyprland/notifications/top.nix= diff --git a/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix b/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix index 8dc637550..311d8bbf0 100644 --- a/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix +++ b/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix @@ -2,10 +2,35 @@ let # Define source and destination paths - script_path = "${flakeRoot}/assets/hyprland/scripts"; source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff"; destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff"; wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf"; + + # Define the script in the let block + copy_wallpapers_script = '' + #!${pkgs.bash}/bin/bash + set -euo pipefail + # Source and destination directories + SOURCE_DIR="${source_path}" + DEST_DIR="${destination_path}" + # Check if source directory exists + if [ ! -d "$SOURCE_DIR" ]; then + echo "Error: Source directory $SOURCE_DIR does not exist." + exit 1 + fi + # Create destination directory if it doesn't exist + mkdir -p "$DEST_DIR" + # Use rsync to copy files, overwriting symlinks and existing files + rsync -av --no-group --no-owner "$SOURCE_DIR/" "$DEST_DIR/" + echo "Config files copied from $SOURCE_DIR to $DEST_DIR. Symlinks replaced with editable files." + ''; + + # Print the script contents during the build + _ = builtins.trace (lib.concatStringsSep "\n" [ + "=== Contents of copy-wallpapers.sh ===" + copy_wallpapers_script + "=== End of copy-wallpapers.sh ===" + ]); in { options = { wallpaper.enable = lib.mkEnableOption "Wallpaper setup"; @@ -13,32 +38,12 @@ in { config = lib.mkIf config.wallpaper.enable { # Use a script to copy all files from source to destination - home-manager.users.${config.home.username}.home.file."${script_path}/copy-wallpapers.sh".text = '' - #!${pkgs.bash}/bin/bash - set -euo pipefail - # Source and destination directories - SOURCE_DIR="${source_path}" - DEST_DIR="${destination_path}" - # Print script contents for debugging - echo "=== Script Contents ===" - cat "$0" - echo "=== End of Script Contents ===" - # Check if source directory exists - if [ ! -d "$SOURCE_DIR" ]; then - echo "Error: Source directory $SOURCE_DIR does not exist." - exit 1 - fi - # Create destination directory if it doesn't exist - mkdir -p "$DEST_DIR" - # Use rsync to copy files, overwriting symlinks and existing files - rsync -av --no-group --no-owner "$SOURCE_DIR/" "$DEST_DIR/" - echo "Config files copied from $SOURCE_DIR to $DEST_DIR. Symlinks replaced with editable files." - ''; - home-manager.users.${config.home.username}.home.file."${script_path}/copy-wallpapers.sh".executable = true; + home-manager.users.${config.home.username}.home.file."${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh".text = copy_wallpapers_script; + home-manager.users.${config.home.username}.home.file."${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh".executable = true; # Run the script on activation home-manager.users.${config.home.username}.home.activation.copy-wallpapers.script = '' - "${script_path}/copy-wallpapers.sh" + "${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh" ''; # Install wpaperd