Add basic theme config

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-23 14:50:50 +03:00
parent 48f391e3ad
commit e7d328cab5
23 changed files with 554 additions and 188 deletions

View File

@@ -1,10 +1,33 @@
{ user ? throw "user argument is required" }: { pkgs, ... }:
{ user ? throw "user argument is required" }: { config, pkgs, ... }:
let
hmConfig = config.home-manager.users."${user.name}";
in
{
home-manager.users."${user.name}" = {
home = {
packages = with pkgs; [ swww ];
persistence."/cache${user.home}".directories = [ ".cache/swww" ];
};
theme.extraConfig = let name = "theme-swww"; in
"${pkgs.writeShellApplication {
inherit name;
runtimeInputs = with pkgs; [
coreutils-full
swww
];
text = ''
if ! pgrep -x "swww-daemon" > /dev/null; then
swww-daemon &> /tmp/swww.log &
fi
while ! swww query &> /dev/null; do
sleep 0.1
done
swww img "${hmConfig.theme.configDir}/wallpaper"
'';
}}/bin/${name}";
};
}