From 2aea6ff2f4a45ae8314497a12a022c205ddd09d4 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 14 Jun 2024 17:31:17 +0100 Subject: [PATCH] fonts and xresources for dwm/st --- home/common/core/fonts.nix | 12 ++++--- .../optional/desktop/common/default.nix | 1 + .../optional/desktop/common/fontconfig.nix | 11 +++++++ home/common/optional/desktop/dwm/default.nix | 3 ++ home/common/optional/desktop/x11/default.nix | 31 +++++++++++++++++++ hosts/common/optional/dwm.nix | 4 +-- pkgs/st/default.nix | 4 +-- 7 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 home/common/optional/desktop/common/fontconfig.nix diff --git a/home/common/core/fonts.nix b/home/common/core/fonts.nix index 2ee9f38..420fe13 100644 --- a/home/common/core/fonts.nix +++ b/home/common/core/fonts.nix @@ -1,10 +1,14 @@ { pkgs, ... }: { fonts.fontconfig.enable = true; - home.packages = [ - pkgs.noto-fonts - pkgs.nerdfonts # loads the complete collection. look into overide for FiraMono or potentially mononoki - pkgs.meslo-lgs-nf + home.packages = with pkgs; [ + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + hack-font + liberation_ttf + font-awesome + libertine ]; } diff --git a/home/common/optional/desktop/common/default.nix b/home/common/optional/desktop/common/default.nix index de06d13..b989fba 100644 --- a/home/common/optional/desktop/common/default.nix +++ b/home/common/optional/desktop/common/default.nix @@ -3,6 +3,7 @@ ./firefox.nix ./alacritty.nix ./zotero.nix + ./fontconfig.nix ]; # Global packages for desktop environments diff --git a/home/common/optional/desktop/common/fontconfig.nix b/home/common/optional/desktop/common/fontconfig.nix new file mode 100644 index 0000000..fd1e97c --- /dev/null +++ b/home/common/optional/desktop/common/fontconfig.nix @@ -0,0 +1,11 @@ +{}: { + fonts = { + fontconfig = { + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Linux Biolinum O" "Noto Color Emoji" "Font Awesome 6 Brands" ]; + monospace = [ "Hack" "Liberation Mono" "Noto Color Emoji" "Font Awesome 6 Brands" ]; + }; + }; + }; +} diff --git a/home/common/optional/desktop/dwm/default.nix b/home/common/optional/desktop/dwm/default.nix index 95dcaff..e0f045b 100644 --- a/home/common/optional/desktop/dwm/default.nix +++ b/home/common/optional/desktop/dwm/default.nix @@ -17,6 +17,9 @@ recursive = true; text = '' + picom -b --config ~/.config/picom/picom.conf + xrdb ~/.Xresources + autostart="dwmblocks feh-wallpaper-changer" for program in $autostart; do diff --git a/home/common/optional/desktop/x11/default.nix b/home/common/optional/desktop/x11/default.nix index 99fd438..30c936a 100644 --- a/home/common/optional/desktop/x11/default.nix +++ b/home/common/optional/desktop/x11/default.nix @@ -9,5 +9,36 @@ pkgs.flameshot pkgs.st pkgs.dmenu + pkgs.picom + pkgs.xclip ]; + + home.file.".Xresources" = { + recursive = true; + text = '' + !st terminal + st.alpha: 0.8 + *.font: monospace:pixelsize=21:antialias=true:autohint=true; + *.font2: NotoColorEmoji:pixelsize=19:antialias=true:autohint=true; + + ! dwm + dwm.borderpx: 3 + ''; + }; + + home.file.".config/picom/picom.conf" = { + recursive = true; + text = '' + vsync = true; + backend = "xrender"; + shadow = true; + shadow-radius = 10; + shadow-offset-x = -5; + shadow-offset-y = -5; + fading = true; + fade-in-step = 0.2; + fade-out-step = 0.2; + fade-delta = 50; + ''; + }; } diff --git a/hosts/common/optional/dwm.nix b/hosts/common/optional/dwm.nix index 171438c..9386358 100644 --- a/hosts/common/optional/dwm.nix +++ b/hosts/common/optional/dwm.nix @@ -15,8 +15,8 @@ domain = "git.bitlab21.com"; owner = "sam"; repo = "dwm"; - rev = "011c32e72e45b124ad6ab5c8185945cd2e637270"; - sha256 = "sha256-rFiGTynYPEDav7ydokkRAHpT2zPFtz+Hn9lZbufEOEg="; + rev = "52638a7cc6c886f6e85e850dea826e24bd963203"; + sha256 = "sha256-azIBPGY26g/gLwEPAQTCdBWl0Z/8q7msNNn9/mw0yHw="; }; }; }; diff --git a/pkgs/st/default.nix b/pkgs/st/default.nix index 2591bb4..130016e 100644 --- a/pkgs/st/default.nix +++ b/pkgs/st/default.nix @@ -12,8 +12,8 @@ pkgs.stdenv.mkDerivation { domain = "git.bitlab21.com"; owner = "sam"; repo = "st"; - rev = "1cde288ca34ad05984a0251a7879005128be085c"; - sha256 = "sha256-4W9w/Efk+YCSP1VuUFr+jPXIyrlpktwxRPUOZHTAtx8="; + rev = "31e0ba8cb2086fb12741afc5fc3dfd938ca1f59b"; + sha256 = "sha256-dbkXFbNr/lJveMeR7qXo7jGgF5+79S9vqKsLM7XM250="; }; nativeBuildInputs = [