From f8e843ec94b44bf44e39617e7b5e48bf3a83c566 Mon Sep 17 00:00:00 2001 From: kenji Date: Fri, 16 Jan 2026 14:38:41 -0600 Subject: [PATCH] feat: add global theme mode and Yazi shortcut - Added theme.mode to config.nix for global dark/light mode control. - Updated Matugen to apply GTK dark mode preferences based on the global theme. - Added a Hyprland bind (SUPER+X) to launch Yazi via uwsm. --- apps/matugen/default.nix | 21 +++++++++++++++++++++ apps/yazi/default.nix | 8 +++++++- config.nix | 6 ++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/apps/matugen/default.nix b/apps/matugen/default.nix index 12ca2e5..9581329 100644 --- a/apps/matugen/default.nix +++ b/apps/matugen/default.nix @@ -352,6 +352,15 @@ platformTheme.name = "gtk"; }; + dconf.settings = { + "org/gnome/desktop/interface" = { + color-scheme = + if myConfig.theme.mode == "dark" + then "prefer-dark" + else "prefer-light"; + }; + }; + # GTK theming with adw-gtk3 and Matugen colors gtk = { enable = true; @@ -364,7 +373,19 @@ package = pkgs.papirus-icon-theme; }; gtk3.extraCss = ''@import url("colors.css");''; + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = + if myConfig.theme.mode == "dark" + then 1 + else 0; + }; gtk4.extraCss = ''@import url("colors.css");''; + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = + if myConfig.theme.mode == "dark" + then 1 + else 0; + }; }; programs.ghostty.settings.theme = "matugen"; diff --git a/apps/yazi/default.nix b/apps/yazi/default.nix index 97ea9d8..578aedf 100644 --- a/apps/yazi/default.nix +++ b/apps/yazi/default.nix @@ -71,6 +71,12 @@ fi ''; in { + wayland.windowManager.hyprland.settings = { + bindd = [ + "SUPER, X, Open File Manager, exec, uwsm app -- yazi" + ]; + }; + programs.yazi = { enable = true; enableFishIntegration = true; @@ -109,7 +115,7 @@ in { default=hyprland;gtk org.freedesktop.impl.portal.FileChooser=termfilechooser ''; - + xdg.mimeApps = { enable = true; defaultApplications = { diff --git a/config.nix b/config.nix index b273c64..b4d7c2a 100644 --- a/config.nix +++ b/config.nix @@ -16,6 +16,9 @@ email = "kenji@hakase"; defaultBranch = "master"; }; + theme = { + mode = "dark"; + }; terminal = { default = "ghostty"; font = "MonoLisa"; @@ -74,6 +77,9 @@ email = "kenji@macbook"; defaultBranch = "master"; }; + theme = { + mode = "dark"; + }; terminal = { default = "ghostty"; font = "MonoLisa";