Simplify font logic

This commit is contained in:
Bun 2025-05-08 09:27:18 -04:00
parent 5259082f76
commit 7a246f4e5e
10 changed files with 25 additions and 38 deletions

View file

@ -6,7 +6,7 @@
settings = { settings = {
main = { main = {
term = "xterm-256color"; term = "xterm-256color";
font = "${config.look.fonts.nerd}:size=14.7"; font = "${config.fonts.fontconfig.defaultFonts.monospace}:size=14.7";
}; };
colors = { colors = {
alpha = "0.85"; alpha = "0.85";

View file

@ -7,8 +7,8 @@
profiles = let profiles = let
# FireFox css, based on https://github.com/Dook97/firefox-qutebrowser-userchrome # FireFox css, based on https://github.com/Dook97/firefox-qutebrowser-userchrome
themeFont = '' themeFont = ''
--tab-font: '${config.look.fonts.main}'; --tab-font: '${config.fonts.fontconfig.defaultFonts.sansSerif}';
--urlbar-font: '${config.look.fonts.main}'; --urlbar-font: '${config.fonts.fontconfig.defaultFonts.sansSerif}';
''; '';
themeMain = '' themeMain = ''
:root { :root {
@ -121,8 +121,8 @@
"webgl.disabled" = false; "webgl.disabled" = false;
# Fonts # Fonts
"font.name.serif.x-western" = config.look.fonts.main; "font.name.serif.x-western" = config.fonts.fontconfig.defaultFonts.sansSerif;
"font.name.sans-serif.x-western" = config.look.fonts.main; "font.name.sans-serif.x-western" = config.fonts.fontconfig.defaultFonts.sansSerif;
"font.name.monospace.x-western" = config.look.fonts.nerd; "font.name.monospace.x-western" = config.look.fonts.nerd;
# Theming and visibility # Theming and visibility

View file

@ -1,21 +1,20 @@
{ config, lib, pkgsStable, ... }: { config, lib, pkgsStable, ... }:
{ {
config = lib.mkIf config.home.desktop.enable { home.packages = lib.mkIf config.home.desktop.enable (with pkgsStable; [
home.packages = with pkgsStable; [ liberation_ttf
liberation_ttf twitter-color-emoji
twitter-color-emoji noto-fonts
noto-fonts sarasa-gothic
sarasa-gothic ubuntu_font_family
ubuntu_font_family (nerdfonts.override { fonts = [ "UbuntuMono" ]; })
(nerdfonts.override { fonts = [ "UbuntuMono" ]; }) ]);
];
fonts.fontconfig = { fonts.fontconfig = {
enable = true; enable = config.home.desktop.enable;
defaultFonts = { defaultFonts = {
sansSerif = [ "Ubuntu" ]; sansSerif = [ "Ubuntu" ];
monospace = [ "UbuntuMono Nerd Font Mono" ]; monospace = [ "UbuntuMono Nerd Font Mono" ];
emoji = [ "Twitter Color Emoji" ]; emoji = [ "Twitter Color Emoji" ];
};
}; };
}; };
} }

View file

@ -2,7 +2,7 @@
{ {
gtk = with pkgs; { gtk = with pkgs; {
font = { font = {
name = config.look.fonts.main; name = config.fonts.fontconfig.defaultFonts.sansSerif;
size = 11; size = 11;
}; };
theme = { theme = {

View file

@ -3,6 +3,5 @@
imports = [ imports = [
./border ./border
./colors ./colors
./fonts
]; ];
} }

View file

@ -1,11 +0,0 @@
{ config, lib, ... }:
{
options.look.fonts = lib.mkOption {
type = lib.types.attrs;
};
config.look.fonts = {
main = "Ubuntu";
nerd = "UbuntuMono Nerd Font";
};
}

View file

@ -7,7 +7,7 @@
enable = true; enable = true;
package = pkgs.rofi-wayland; package = pkgs.rofi-wayland;
terminal = "foot"; terminal = "foot";
font = "${config.look.fonts.main} 14"; font = "${config.fonts.fontconfig.defaultFonts.sansSerif} 14";
theme = let theme = let
inherit (config.lib.formats.rasi) mkLiteral; inherit (config.lib.formats.rasi) mkLiteral;
in { in {

View file

@ -13,7 +13,7 @@ in {
settings = { settings = {
clock = true; clock = true;
image = "~/.assets/lockscreen/lock.png"; image = "~/.assets/lockscreen/lock.png";
font = config.look.fonts.main; font = config.fonts.fontconfig.defaultFonts.sansSerif;
font-size = 30; font-size = 30;
timestr = "%I:%M%p"; timestr = "%I:%M%p";
datestr = "%a %b %d %Y"; datestr = "%a %b %d %Y";

View file

@ -300,7 +300,7 @@
border: 0; border: 0;
border-radius: 0; border-radius: 0;
min-height: 0; min-height: 0;
font-family: ${config.look.fonts.main}, ${config.look.fonts.nerd}; font-family: ${config.fonts.fontconfig.defaultFonts.sansSerif}, ${config.fonts.fontconfig.defaultFonts.monospace};
font-size: 15.5px; font-size: 15.5px;
color: #${config.look.colors.text}; color: #${config.look.colors.text};
} }

View file

@ -32,7 +32,7 @@
}; };
}; };
fonts = { fonts = {
names = [ config.look.fonts.main ]; names = [ config.fonts.fontconfig.defaultFonts.sansSerif ];
size = 10.5; size = 10.5;
}; };
window = { window = {