nixconfig/home/gui/theme/default.nix

62 lines
1.2 KiB
Nix
Raw Normal View History

2023-04-12 20:32:07 +02:00
{
pkgs,
inputs,
config,
...
}:
let
colorVariant = " black";
gtkThemeFromScheme = import ./gtk-theme-gen.nix { inherit pkgs config; };
wallpaperGen = import ./wallpaper-gen.nix {inherit pkgs config; };
in
{
home.pointerCursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
gtk.enable = true;
x11.enable = true;
};
gtk = {
enable = true;
theme = {
name = "${config.colorscheme.slug}";
package = gtkThemeFromScheme;
};
iconTheme = {
name = "tela-circle-icon-theme";
package = pkgs.tela-circle-icon-theme;
};
};
qt = {
enable = true;
platformTheme = "gtk";
};
home.packages = [
wallpaperGen
];
xdg.configFile."script/wallpaper.sh".text = ''
#!/bin/sh
NIXDIR=${wallpaperGen}
WPDIR=$NIXDIR/share/wallpaper/
IMGS=$(find $WPDIR -type f -print)
RES=$(echo "$IMGS" | awk -v dir="$WPDIR" '{
image_file = $0;
gsub("^" dir, "", image_file);
print "img:" $0 ":text:" image_file;
}')
IMG=$WPDIR/$(echo "$RES" | wofi --dmenu --allow-images show-icons true -theme-str '#window { width: 50%; }' -p "Choose wallpaper:")
IMG=$(echo "$IMG" | awk -F ':' '{print $2}')
swww img $IMG
'';
}