From 4acb6e24083aad655bf0da9d5b48609b5064de0b Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 27 Jan 2025 19:01:09 -0600 Subject: [PATCH] split theme into its own module and add xdg configuration --- home/modules/baseline.nix | 11 --------- home/modules/gui/default.nix | 48 ++++++++---------------------------- home/modules/gui/theme.nix | 43 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 49 deletions(-) create mode 100644 home/modules/gui/theme.nix diff --git a/home/modules/baseline.nix b/home/modules/baseline.nix index 70f0e83..fd61864 100644 --- a/home/modules/baseline.nix +++ b/home/modules/baseline.nix @@ -13,17 +13,6 @@ in { config = mkIf cfg.enable { xdg = { enable = true; - mimeApps = { - enable = true; - defaultApplications = {}; - }; - portal = { - # this shouldnt be on baseline, as servers have no GUI - enable = true; - xdgOpenUsePortal = true; - extraPortals = with pkgs; [xdg-desktop-portal-gtk]; #wtf is this - configPackages = with pkgs; [xdg-desktop-portal-gtk]; #wtf is this - }; }; home = { diff --git a/home/modules/gui/default.nix b/home/modules/gui/default.nix index 54bf1bb..bca09e9 100644 --- a/home/modules/gui/default.nix +++ b/home/modules/gui/default.nix @@ -81,8 +81,9 @@ in { ./fonts.nix ./i3.nix ./polybar.nix - ./startx.nix # move to ly once 24.11 comes out :( + ./startx.nix ./picom.nix + ./theme.nix ]; config = let @@ -113,45 +114,16 @@ in { picom.enable = true; }; - gtk = { + xdg = { enable = true; - - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; + mimeApps = { + enable = true; + defaultApplications = { + "application/pdf" = with pkgs; ["qpdfview"]; + "text/uri-list" = with pkgs; ["firefox"]; + "x-scheme-handler/file" = with pkgs; ["kitty"]; + }; }; - theme = { - package = pkgs.materia-theme; - name = "Materia-dark"; - }; - - gtk2.extraConfig = '' - gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ - gtk-menu-images=1 - gtk-button-images=1 - ''; - - gtk3.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - gtk4.extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - }; - - #qt = { mentioning qt makes qt applications not work, I should probably check how to fix this - # enable = true; - # style.name = "bb10dark"; - #}; - - home.sessionVariables = { - # Use gtk in jvm apps - _JAVA_OPTIONS = concatStringsSep " " [ - "-Dawt.useSystemAAFontSettings=on" - "-Dswing.aatext=true" - "-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" - "-Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" - ]; }; }; } diff --git a/home/modules/gui/theme.nix b/home/modules/gui/theme.nix new file mode 100644 index 0000000..fa1e098 --- /dev/null +++ b/home/modules/gui/theme.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; { + gtk = { + enable = true; + + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + theme = { + package = pkgs.materia-theme; + name = "Materia-dark"; + }; + + gtk2.extraConfig = '' + gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ + gtk-menu-images=1 + gtk-button-images=1 + ''; + + gtk3.extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + gtk4.extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + }; + + home.sessionVariables = { + # Use gtk in jvm apps + _JAVA_OPTIONS = concatStringsSep " " [ + "-Dawt.useSystemAAFontSettings=on" + "-Dswing.aatext=true" + "-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" + "-Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel" + ]; + }; +}