new wallpaperthingie
This commit is contained in:
@@ -3,47 +3,43 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
flakeRoot,
|
flakeRoot,
|
||||||
|
user,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
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_wallpaperstuff.sh";
|
script_path = "${flakeRoot}/assets/hyprland/scripts/copy_wallpaperstuff.sh";
|
||||||
wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options.wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
||||||
wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf config.wallpaper.enable {
|
config = lib.mkIf config.wallpaper.enable {
|
||||||
# Ensure the script is executable
|
home-manager.users.${user.username} = {
|
||||||
home-manager.users.${config.home.username}.home.file."${script_path}".executable = true;
|
|
||||||
|
|
||||||
# Run the script on activation
|
# Install wpaperd
|
||||||
home-manager.users.${config.home.username}.home.activation.copy-wallpapers = {
|
home.packages = with pkgs; [ wpaperd ];
|
||||||
description = "Copy wallpapers and set up wpaperd";
|
|
||||||
script = ''
|
# Make script available in home
|
||||||
|
home.file."copy_wallpaperstuff.sh" = {
|
||||||
|
source = script_path;
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Activation script
|
||||||
|
home.activation.copy-wallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
echo "=== Activation Script Running ==="
|
echo "=== Activation Script Running ==="
|
||||||
echo "Script path: ${script_path}"
|
|
||||||
if [ -f "${script_path}" ]; then
|
if [ -f "$HOME/copy_wallpaperstuff.sh" ]; then
|
||||||
echo "Script exists, executing..."
|
echo "Executing wallpaper script..."
|
||||||
chmod +x "${script_path}"
|
"$HOME/copy_wallpaperstuff.sh"
|
||||||
"${script_path}"
|
|
||||||
else
|
else
|
||||||
echo "ERROR: Script does not exist at ${script_path}"
|
echo "ERROR: Script not found in home"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# wpaperd config
|
||||||
|
xdg.configFile."wpaperd/config.toml".text = builtins.readFile wallpaper_conf;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Install wpaperd
|
|
||||||
home-manager.users.${config.home.username}.home.packages = with pkgs; [ wpaperd ];
|
|
||||||
|
|
||||||
# Create the config directory and file for wpaperd
|
|
||||||
home-manager.users.${config.home.username}.xdg.configFile."wpaperd/config.toml".text =
|
|
||||||
builtins.readFile "${wallpaper_conf}";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user