Add wallpaper-based color theming with matugen
- Matugen templates for Ghostty theme and GTK4 colors - Ghostty uses generated wallpaper theme instead of Catppuccin - GTK4 CSS imports generated color overrides - Update alias runs matugen after switch to regenerate colors - Add wallpaper fish function to change wallpaper + regen colors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7a6ee02360
commit
effa5e5cbb
6 changed files with 73 additions and 3 deletions
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
# Shell aliases (work in both bash and fish)
|
# Shell aliases (work in both bash and fish)
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
update = "bash -c 'OLD_SYSTEM=$(readlink /run/current-system) && sudo nixos-rebuild build $@ --flake github:ediblerope/nixos-config && sudo nixos-rebuild switch $@ --flake github:ediblerope/nixos-config && nvd diff $OLD_SYSTEM /run/current-system' --";
|
update = "bash -c 'OLD_SYSTEM=$(readlink /run/current-system) && sudo nixos-rebuild build $@ --flake github:ediblerope/nixos-config && sudo nixos-rebuild switch $@ --flake github:ediblerope/nixos-config && nvd diff $OLD_SYSTEM /run/current-system && matugen image ~/.local/share/backgrounds/wallpaper.png --source-color-index 0 -m dark' --";
|
||||||
clean = "sudo nix-collect-garbage -d";
|
clean = "sudo nix-collect-garbage -d";
|
||||||
ll = "ls -alh";
|
ll = "ls -alh";
|
||||||
clear = "command clear";
|
clear = "command clear";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# settings/fred.nix
|
# settings/fred.nix
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, inputs, ... }:
|
||||||
{
|
{
|
||||||
# Define the state version for Home Manager
|
# Define the state version for Home Manager
|
||||||
home.stateVersion = "25.11";
|
home.stateVersion = "25.11";
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
font-family = FiraMono Nerd Font
|
font-family = FiraMono Nerd Font
|
||||||
font-size = 11
|
font-size = 11
|
||||||
font-thicken = true
|
font-thicken = true
|
||||||
theme = dark:Catppuccin Mocha,light:Catppuccin Latte
|
theme = wallpaper
|
||||||
window-padding-x = 10
|
window-padding-x = 10
|
||||||
window-padding-y = 10
|
window-padding-y = 10
|
||||||
window-padding-balance = true
|
window-padding-balance = true
|
||||||
|
|
@ -31,4 +31,19 @@
|
||||||
cursor-style-blink = true
|
cursor-style-blink = true
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Matugen config — templates for wallpaper-based color generation
|
||||||
|
home.file.".config/matugen/config.toml".text = ''
|
||||||
|
[config]
|
||||||
|
reload_apps = true
|
||||||
|
reload_apps_list = { ghostty = "" }
|
||||||
|
|
||||||
|
[templates.ghostty]
|
||||||
|
input_path = "${inputs.self}/templates/ghostty-colors"
|
||||||
|
output_path = "~/.config/ghostty/themes/wallpaper"
|
||||||
|
|
||||||
|
[templates.gtk4]
|
||||||
|
input_path = "${inputs.self}/templates/gtk4-colors.css"
|
||||||
|
output_path = "~/.config/gtk-4.0/colors.css"
|
||||||
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
# Minimal titlebars — hide window buttons and shrink headerbar
|
# Minimal titlebars — hide window buttons and shrink headerbar
|
||||||
home.file.".config/gtk-4.0/gtk.css".force = true;
|
home.file.".config/gtk-4.0/gtk.css".force = true;
|
||||||
home.file.".config/gtk-4.0/gtk.css".text = ''
|
home.file.".config/gtk-4.0/gtk.css".text = ''
|
||||||
|
@import url("colors.css");
|
||||||
headerbar {
|
headerbar {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
||||||
|
|
@ -127,5 +127,23 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
function fish_right_prompt; end
|
function fish_right_prompt; end
|
||||||
|
|
||||||
|
# Set wallpaper and regenerate color theme
|
||||||
|
function wallpaper
|
||||||
|
if test (count $argv) -ne 1
|
||||||
|
echo "Usage: wallpaper <path-to-image>"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
set -l img (realpath "$argv[1]")
|
||||||
|
if not test -f "$img"
|
||||||
|
echo "File not found: $img"
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
cp "$img" ~/.local/share/backgrounds/wallpaper.png
|
||||||
|
gsettings set org.gnome.desktop.background picture-uri "file://$HOME/.local/share/backgrounds/wallpaper.png"
|
||||||
|
gsettings set org.gnome.desktop.background picture-uri-dark "file://$HOME/.local/share/backgrounds/wallpaper.png"
|
||||||
|
matugen image "$img" --source-color-index 0 -m dark
|
||||||
|
echo "Wallpaper and colors updated!"
|
||||||
|
end
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
templates/ghostty-colors
Normal file
21
templates/ghostty-colors
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
palette = 0={{colors.base16.base00.default.color}}
|
||||||
|
palette = 1={{colors.base16.base08.default.color}}
|
||||||
|
palette = 2={{colors.base16.base0b.default.color}}
|
||||||
|
palette = 3={{colors.base16.base0a.default.color}}
|
||||||
|
palette = 4={{colors.base16.base0d.default.color}}
|
||||||
|
palette = 5={{colors.base16.base0e.default.color}}
|
||||||
|
palette = 6={{colors.base16.base0c.default.color}}
|
||||||
|
palette = 7={{colors.base16.base05.default.color}}
|
||||||
|
palette = 8={{colors.base16.base03.default.color}}
|
||||||
|
palette = 9={{colors.base16.base08.default.color}}
|
||||||
|
palette = 10={{colors.base16.base0b.default.color}}
|
||||||
|
palette = 11={{colors.base16.base0a.default.color}}
|
||||||
|
palette = 12={{colors.base16.base0d.default.color}}
|
||||||
|
palette = 13={{colors.base16.base0e.default.color}}
|
||||||
|
palette = 14={{colors.base16.base0c.default.color}}
|
||||||
|
palette = 15={{colors.base16.base07.default.color}}
|
||||||
|
background = {{colors.primary.surface.default.color}}
|
||||||
|
foreground = {{colors.primary.on_surface.default.color}}
|
||||||
|
cursor-color = {{colors.primary.primary.default.color}}
|
||||||
|
selection-background = {{colors.primary.primary_container.default.color}}
|
||||||
|
selection-foreground = {{colors.primary.on_primary_container.default.color}}
|
||||||
15
templates/gtk4-colors.css
Normal file
15
templates/gtk4-colors.css
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
@define-color accent_color {{colors.primary.primary.default.color}};
|
||||||
|
@define-color accent_bg_color {{colors.primary.primary_container.default.color}};
|
||||||
|
@define-color accent_fg_color {{colors.primary.on_primary_container.default.color}};
|
||||||
|
@define-color window_bg_color {{colors.primary.surface.default.color}};
|
||||||
|
@define-color window_fg_color {{colors.primary.on_surface.default.color}};
|
||||||
|
@define-color view_bg_color {{colors.primary.surface_container_low.default.color}};
|
||||||
|
@define-color view_fg_color {{colors.primary.on_surface.default.color}};
|
||||||
|
@define-color headerbar_bg_color {{colors.primary.surface_container.default.color}};
|
||||||
|
@define-color headerbar_fg_color {{colors.primary.on_surface.default.color}};
|
||||||
|
@define-color card_bg_color {{colors.primary.surface_container_high.default.color}};
|
||||||
|
@define-color card_fg_color {{colors.primary.on_surface.default.color}};
|
||||||
|
@define-color sidebar_bg_color {{colors.primary.surface_container.default.color}};
|
||||||
|
@define-color sidebar_fg_color {{colors.primary.on_surface.default.color}};
|
||||||
|
@define-color popover_bg_color {{colors.primary.surface_container.default.color}};
|
||||||
|
@define-color popover_fg_color {{colors.primary.on_surface.default.color}};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue