Setting up rotating wallpapers
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
# Define source and destination paths
|
||||
source_path = "${flakeRoot}/assets/hyprland/wallpaperstuff";
|
||||
destination_path = "${config.home.username}/Droidnix/wallpaperstuff";
|
||||
wallpaper_conf = "${destination_path}/wallpaper.conf";
|
||||
# wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf";
|
||||
in {
|
||||
options = {
|
||||
wallpaper.enable = lib.mkEnableOption "Wallpaper setup";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.wallpaper.enable {
|
||||
# Ensure the destination directory exists
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}".createDir = true;
|
||||
|
||||
# Copy all files from source to destination
|
||||
home-manager.users.${config.home.username}.home.file."${destination_path}".source = lib.genAttrs (builtins.attrNames (builtins.readDir source_path)) (name: {
|
||||
source = "${source_path}/${name}";
|
||||
target = "${destination_path}/${name}";
|
||||
recursive = true;
|
||||
onChange = "copy";
|
||||
});
|
||||
|
||||
# Install wpaperd
|
||||
home-manager.users.${config.home.username}.home.packages = [ pkgs.wpaperd ];
|
||||
|
||||
# Configure wpaperd
|
||||
home-manager.users.${config.home.username}.home.file."${config.home.homeDirectory}/.config/wpaperd/config.toml".text = wallpaper_conf
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
{ config, pkgs, lib, user, inputs, flakeRoot,... }:
|
||||
{
|
||||
imports = [
|
||||
# No subfolders to import
|
||||
./rotating_wallpaper
|
||||
];
|
||||
# .. put any code here
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user