add(matugen): auto-theme switch

This commit is contained in:
kenji
2026-01-10 23:01:23 -06:00
parent 51a35355df
commit 461b1099ad
3 changed files with 18 additions and 0 deletions
+5
View File
@@ -55,3 +55,8 @@ post_hook = "makoctl reload"
input_path = "~/.config/matugen/templates/vicinae" input_path = "~/.config/matugen/templates/vicinae"
output_path = "~/.local/share/vicinae/themes/matugen.toml" output_path = "~/.local/share/vicinae/themes/matugen.toml"
post_hook = "vicinae theme set matugen" post_hook = "vicinae theme set matugen"
[templates.theme-switch]
input_path = "~/.config/matugen/templates/theme-switch"
output_path = "~/.config/matugen/scripts/theme-switch.sh"
post_hook = "sh ~/.config/matugen/scripts/theme-switch.sh"
+2
View File
@@ -6,6 +6,7 @@
}: { }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
matugen matugen
dconf
psmisc # for killall psmisc # for killall
]; ];
home.file.".config/matugen/config.toml" = { home.file.".config/matugen/config.toml" = {
@@ -13,6 +14,7 @@
}; };
# Copy static templates # Copy static templates
home.file.".config/matugen/templates/theme-switch".source = ./templates/theme-switch;
home.file.".config/matugen/templates/cava".source = ./templates/cava; home.file.".config/matugen/templates/cava".source = ./templates/cava;
home.file.".config/matugen/templates/firefox".source = ./templates/firefox; home.file.".config/matugen/templates/firefox".source = ./templates/firefox;
home.file.".config/matugen/templates/ghostty".source = ./templates/ghostty; home.file.".config/matugen/templates/ghostty".source = ./templates/ghostty;
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
# Generated by Matugen
# mode will be replaced by 'dark' or 'light'
MODE="{{mode}}"
if [ "$MODE" = "dark" ]; then
${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/color-scheme "'prefer-dark'"
else
${pkgs.dconf}/bin/dconf write /org/gnome/desktop/interface/color-scheme "'prefer-light'"
fi