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 = {
main = {
term = "xterm-256color";
font = "${config.look.fonts.nerd}:size=14.7";
font = "${config.fonts.fontconfig.defaultFonts.monospace}:size=14.7";
};
colors = {
alpha = "0.85";

View file

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

View file

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

View file

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

View file

@ -3,6 +3,5 @@
imports = [
./border
./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;
package = pkgs.rofi-wayland;
terminal = "foot";
font = "${config.look.fonts.main} 14";
font = "${config.fonts.fontconfig.defaultFonts.sansSerif} 14";
theme = let
inherit (config.lib.formats.rasi) mkLiteral;
in {

View file

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

View file

@ -300,7 +300,7 @@
border: 0;
border-radius: 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;
color: #${config.look.colors.text};
}

View file

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