diff --git a/Droidnix/README.org b/Droidnix/README.org index 5f688c25c..bddbc97af 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -786,29 +786,15 @@ let # Define source and destination paths source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff"; destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff"; - script_path = "${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh"; + script_path = "${flakeRoot}/assets/hyprland/scripts/copy_wallpaperstuff.sh"; wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf"; - - # Define the script in the let block - copy_wallpapers_script = '' - Echo "hoi" - ''; - - # Print the script contents during the build - traceScript = 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"; }; 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}".text = copy_wallpapers_script; + # Ensure the script is executable home-manager.users.${config.home.username}.home.file."${script_path}".executable = true; # Run the script on activation @@ -817,6 +803,7 @@ in { cat "${script_path}" "${script_path}" ''; + # Install wpaperd home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ]; @@ -824,7 +811,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/assets/hyprland/scripts/copy_wallpaperstuff.sh b/Droidnix/assets/hyprland/scripts/copy_wallpaperstuff.sh new file mode 100755 index 000000000..6ca933353 --- /dev/null +++ b/Droidnix/assets/hyprland/scripts/copy_wallpaperstuff.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail +# Source and destination directories +SOURCE_DIR="../wallpaperstuff" +DEST_DIR="$HOME/Droidnix/" +# Check if source directory exists +if [ ! -d "$SOURCE_DIR" ]; then + echo "Error: Source directory $SOURCE_DIR does not exist." + exit 1 +fi +if [ ! -d "$DEST_DIR" ]; then + mkdir -p $DEST_DIR +fi +# Use rsync to copy files, overwriting symlinks and existing files +# --no-group --no-owner preserves your user ownership +rsync -av --no-group --no-owner "$SOURCE_DIR/" "$DEST_DIR/" +echo "Config files copied from $SOURCE_DIR to $DEST_DIR." diff --git a/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix b/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix index 3617ca4a3..9cb42dff5 100644 --- a/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix +++ b/Droidnix/generated/hyprland/decorations/rotating_wallpaper.nix @@ -4,29 +4,15 @@ let # Define source and destination paths source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff"; destination_path = "${config.home.homeDirectory}/Droidnix/wallpaperstuff"; - script_path = "${flakeRoot}/assets/hyprland/scripts/copy-wallpapers.sh"; + script_path = "${flakeRoot}/assets/hyprland/scripts/copy_wallpaperstuff.sh"; wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf"; - - # Define the script in the let block - copy_wallpapers_script = '' - Echo "hoi" - ''; - - # Print the script contents during the build - traceScript = 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"; }; 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}".text = copy_wallpapers_script; + # Ensure the script is executable home-manager.users.${config.home.username}.home.file."${script_path}".executable = true; # Run the script on activation @@ -35,6 +21,7 @@ in { cat "${script_path}" "${script_path}" ''; + # Install wpaperd home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ];