2024-10-21 22:40:16 +07:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
unstable,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
2024-10-21 17:15:48 +07:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
cfg = config.profile.hyprland;
|
|
|
|
inherit (lib.meta) getExe;
|
|
|
|
wallpaperDir = "${config.home.homeDirectory}/.cache/wallpaper";
|
|
|
|
initWallPaperScript =
|
|
|
|
pkgs.writeShellScriptBin "init-wallpaper.sh"
|
|
|
|
# sh
|
|
|
|
''
|
2024-10-21 17:37:37 +07:00
|
|
|
init_wallpaper="${./wallpaper.jpeg}"
|
2024-10-21 17:15:48 +07:00
|
|
|
cache_file="${wallpaperDir}/current"
|
|
|
|
blurred="${wallpaperDir}/blurred.png"
|
|
|
|
square="${wallpaperDir}/square.png"
|
|
|
|
|
|
|
|
mkdir -p "${wallpaperDir}"
|
|
|
|
|
|
|
|
if [ ! -f "$cache_file" ]; then
|
|
|
|
cp "$init_wallpaper" "$cache_file"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$blurred" ]; then
|
|
|
|
${pkgs.graphicsmagick}/bin/gm convert -resize 75% -blur 50x30 "$cache_file" "$blurred"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$square" ]; then
|
|
|
|
${pkgs.imagemagick}/bin/magick "$cache_file" -resize 25% -gravity Center -extent 1:1 "$square"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "${config.home.homeDirectory}/.cache/wallust/sequences" ]; then
|
|
|
|
wallust run "$cache_file"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
2024-10-21 17:35:51 +07:00
|
|
|
./alacritty.nix
|
2024-10-21 17:15:48 +07:00
|
|
|
./foot.nix
|
|
|
|
./hyprland.nix
|
|
|
|
./kitty.nix
|
2024-10-21 17:35:51 +07:00
|
|
|
./rofi.nix
|
2024-10-23 19:54:15 +07:00
|
|
|
./swaync.nix
|
2024-10-21 17:15:48 +07:00
|
|
|
./waybar.nix
|
|
|
|
./wlogout.nix
|
|
|
|
];
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
home.packages = [
|
|
|
|
pkgs.imagemagick
|
|
|
|
unstable.wallust
|
|
|
|
];
|
|
|
|
|
|
|
|
wayland.windowManager.hyprland.settings.exec-once = lib.mkOrder 10 ([
|
|
|
|
(getExe initWallPaperScript)
|
|
|
|
]);
|
|
|
|
|
2024-10-21 20:38:05 +07:00
|
|
|
# See https://codeberg.org/explosion-mental/wallust/src/branch/master/wallust.toml
|
2024-10-21 17:15:48 +07:00
|
|
|
home.file.".config/wallust/wallust.toml".source = (
|
2024-10-21 22:40:16 +07:00
|
|
|
(pkgs.formats.toml { }).generate "wallust.toml" (
|
|
|
|
lib.attrsets.mergeAttrsList [
|
|
|
|
{
|
|
|
|
backend = "kmeans";
|
|
|
|
color_space = "lch";
|
|
|
|
alpha = 100;
|
|
|
|
threshold = 1;
|
|
|
|
palette = "dark";
|
2024-10-21 23:17:24 +07:00
|
|
|
check_contrast = true;
|
2024-10-21 22:40:16 +07:00
|
|
|
}
|
|
|
|
cfg.wallust.settings
|
|
|
|
]
|
|
|
|
)
|
2024-10-21 17:15:48 +07:00
|
|
|
);
|
|
|
|
};
|
|
|
|
}
|