1

Modules/Hyprland: Update wallpaper and add rofi menu to select wallpapers

This commit is contained in:
2025-07-20 01:48:16 +02:00
parent 1688aad11c
commit 711b78f77e
14 changed files with 94 additions and 18 deletions

View File

@ -227,7 +227,7 @@ in {
background = [
{
path = "~/NixFlake/wallpapers/${hyprland.theme}.png";
path = "${config.paths.nixflake}/wallpapers/${hyprland.wallpaper}.jpg";
blur_passes = 3;
blur_size = 10;
monitor = "";
@ -293,11 +293,15 @@ in {
splash = false;
splash_offset = 2.0;
preload = "${config.paths.nixflake}/wallpapers/${hyprland.theme}.png";
# Wallpapers have to be preloaded to be displayed
preload = let
mkPreload = name: "${config.paths.nixflake}/wallpapers/${name}.jpg";
in
hyprland.wallpapers |> builtins.map mkPreload;
wallpaper = let
mkWallpaper = monitor:
"${monitor}, "
+ "${config.paths.nixflake}/wallpapers/${hyprland.theme}.png";
+ "${config.paths.nixflake}/wallpapers/${hyprland.wallpaper}.jpg";
in
hyprland.monitors
|> builtins.attrNames

View File

@ -2,7 +2,7 @@
lib,
mylib,
...
}: {
}: rec {
enable = lib.mkEnableOption "Hyprland Window Manager + Compositor";
kb-layout = lib.mkOption {
@ -17,10 +17,32 @@
description = "Keyboard layout variant";
};
theme = lib.mkOption {
type = lib.types.str;
# A bit dumb, but I want a single location where those are defined.
# Only supposed to be set from here.
wallpapers = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "Available wallpapers";
# Run eza -1 | sd ".png" "" | sd "^" "\"" | sd "\$" "\"" | sd "\"\"" "" | wl-copy
# in ~/NixFlake/wallpapers/
default = [
"Blade-Runner-Atari"
"Blade-Runner-Coca-Cola"
"Blade-Runner-Downwards"
"Blade-Runner-Upwards"
"City-Outlook"
"Cozy-Bedroom"
"Everest-Fishing"
"Foggy-Lake"
"Three-Bears"
];
};
wallpaper = lib.mkOption {
type = lib.types.enum wallpapers.default;
example = "Three-Bears";
description = "Wallpaper and colorscheme to use";
description = "Wallpaper to use";
default = "Foggy-Lake";
};
dunst.enable = lib.mkEnableOption "Enable dunst notification daemon";