From 0415c86f9f6b08ab824ce56b89615c18c814d1da Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sat, 26 Apr 2025 18:21:10 +0200 Subject: [PATCH] Fix gtk and cursor theme --- .../nixos/graphical/compositor/default.nix | 3 +- modules/nixos/graphical/theme/default.nix | 112 ++++++++---------- 2 files changed, 51 insertions(+), 64 deletions(-) diff --git a/modules/nixos/graphical/compositor/default.nix b/modules/nixos/graphical/compositor/default.nix index 5ddfc17d..01a61b83 100644 --- a/modules/nixos/graphical/compositor/default.nix +++ b/modules/nixos/graphical/compositor/default.nix @@ -30,7 +30,6 @@ let export GDK_SCALE=1 export GDK_DPI_SCALE=1 export MOZ_ENABLE_WAYLAND=1 - export XCURSOR_SIZE=24 export _JAVA_AWT_WM_NONREPARENTING=1 if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then export DBUS_SESSION_BUS_ADDRESS @@ -152,7 +151,7 @@ let riverctl focus-follows-cursor normal riverctl hide-cursor when-typing enabled riverctl set-cursor-warp on-output-change - riverctl xcursor-theme Catppuccin-Latte-Light-Cursors 24 + riverctl xcursor-theme ${config.home-manager.users.charlotte.home.pointerCursor.name} ${toString config.home-manager.users.charlotte.home.pointerCursor.size} riverctl keyboard-layout -variant altgr-intl -options compose:caps us diff --git a/modules/nixos/graphical/theme/default.nix b/modules/nixos/graphical/theme/default.nix index 57dc2667..cc790f96 100644 --- a/modules/nixos/graphical/theme/default.nix +++ b/modules/nixos/graphical/theme/default.nix @@ -1,5 +1,8 @@ { config, lib, pkgs, ... }: +let + gtkTheme = pkgs.colloid-gtk-theme.override { themeVariants = [ "orange" ]; colorVariants = [ "light" "dark" ]; sizeVariants = [ "compact" ]; tweaks = [ "catppuccin" ]; }; +in { options.chvp.graphical.theme.enable = lib.mkOption { default = false; @@ -39,15 +42,16 @@ home.packages = [ pkgs.catppuccin-cursors.latteLight # Also install dark mode to profile for darkman - (pkgs.catppuccin-gtk.override { size = "compact"; variant = "frappe"; }) + gtkTheme ]; - home.file = { - ".icons/default/index.theme".text = '' - [Icon Theme] - Name=Default - Comment=Default Cursor Theme - Inherits=catppuccin-latte-light-cursors - ''; + home.pointerCursor = { + enable = true; + package = pkgs.catppuccin-cursors.latteLight; + dotIcons.enable = true; + gtk.enable = true; + x11.enable = true; + name = "catppuccin-latte-light-cursors"; + size = 24; }; dconf.settings."org/gnome/desktop/wm/preferences".button-layout = ""; gtk = { @@ -57,65 +61,49 @@ name = "Noto Sans"; size = 10; }; - gtk2.extraConfig = '' - gtk-cursor-theme-name = "catppuccin-latte-light-cursors" - gtk-cursor-theme-size = 24 + gtk3.extraCss = '' + /* No (default) titlebar on wayland */ + headerbar.titlebar.default-decoration { + background: transparent; + padding: 0; + margin: 0 0 -17px 0; + border: 0; + min-height: 0; + font-size: 0; + box-shadow: none; + } + + /* rm -rf window shadows */ + window.csd, /* gtk4? */ + window.csd decoration { /* gtk3 */ + box-shadow: none; + } ''; - gtk3 = { - extraConfig = { - gtk-cursor-theme-name = "catppuccin-latte-light-cursors"; - gtk-cursor-theme-size = 24; - }; - extraCss = '' - /* No (default) titlebar on wayland */ - headerbar.titlebar.default-decoration { - background: transparent; - padding: 0; - margin: 0 0 -17px 0; - border: 0; - min-height: 0; - font-size: 0; - box-shadow: none; - } + gtk4.extraCss = '' + /* No (default) titlebar on wayland */ + headerbar.titlebar.default-decoration { + background: transparent; + padding: 0; + margin: 0 0 -17px 0; + border: 0; + min-height: 0; + font-size: 0; + box-shadow: none; + } - /* rm -rf window shadows */ - window.csd, /* gtk4? */ - window.csd decoration { /* gtk3 */ - box-shadow: none; - } - ''; - }; - gtk4 = { - extraConfig = { - gtk-cursor-theme-name = "catppuccin-latte-light-cursors"; - gtk-cursor-theme-size = 24; - }; - extraCss = '' - /* No (default) titlebar on wayland */ - headerbar.titlebar.default-decoration { - background: transparent; - padding: 0; - margin: 0 0 -17px 0; - border: 0; - min-height: 0; - font-size: 0; - box-shadow: none; - } - - /* rm -rf window shadows */ - window.csd, /* gtk4? */ - window.csd decoration { /* gtk3 */ - box-shadow: none; - } - ''; - }; + /* rm -rf window shadows */ + window.csd, /* gtk4? */ + window.csd decoration { /* gtk3 */ + box-shadow: none; + } + ''; iconTheme = { package = pkgs.libsForQt5.breeze-icons; name = "breeze"; }; theme = { - package = pkgs.catppuccin-gtk.override { size = "compact"; variant = "latte"; }; - name = "Catppuccin-Latte-Compact-Blue-Light"; + package = gtkTheme; + name = "Colloid-Orange-Light-Compact-Catppuccin"; }; }; qt = { @@ -140,7 +128,7 @@ emacsclient --eval "(chvp--dark-mode)" ''; gtk = '' - ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Frappe-Compact-Blue-Dark + ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Colloid-Orange-Dark-Compact-Catppuccin ''; river = '' riverctl background-color 0x626880 @@ -165,7 +153,7 @@ emacsclient --eval "(chvp--light-mode)" ''; gtk = '' - ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Catppuccin-Latte-Compact-Blue-Light + ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme Colloid-Orange-Light-Compact-Catppuccin ''; river = '' riverctl background-color 0xacb0be