From a023a9f103e5298656f269aea64cfb30d1fe8db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Tue, 24 Jan 2023 11:42:49 -0300 Subject: [PATCH] theme: fix gtk light theme not being set --- system/sway.nix | 8 ++++++-- user/alacritty.nix | 7 +++++-- user/bmenu.nix | 7 +++++-- user/fzf.nix | 3 ++- user/helix.nix | 7 +++++-- user/kakoune.nix | 7 +++++-- user/qutebrowser/default.nix | 7 +++++-- user/rofi.nix | 7 +++++-- user/sway.nix | 3 ++- user/theme.nix | 14 +++++++++----- user/variables.nix | 13 ++++++++----- user/waybar.nix | 7 +++++-- user/zathura.nix | 7 +++++-- 13 files changed, 67 insertions(+), 30 deletions(-) diff --git a/system/sway.nix b/system/sway.nix index 3c1273d..0c57573 100644 --- a/system/sway.nix +++ b/system/sway.nix @@ -1,4 +1,8 @@ -{ pkgs, ... }: { +{ pkgs, ... }: +let + inherit (pkgs.uservars) key accent font theme; +in +{ # Enable the X11 windowing system. services.xserver.enable = false; @@ -20,7 +24,7 @@ let greetd_main_script = pkgs.writeShellScriptBin "main" '' ${pkgs.dbus-sway-environment}/bin/dbus-sway-environment - export XDG_CURRENT_DESKTOP=sway GTK_THEME="${pkgs.uservars.gtk_theme}" XCURSOR_THEME="${pkgs.uservars.cursor_theme}" + export XDG_CURRENT_DESKTOP=sway GTK_THEME="${theme.gtk_theme}" XCURSOR_THEME="${theme.cursor_theme}" ${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -c sway swaymsg exit ''; diff --git a/user/alacritty.nix b/user/alacritty.nix index 8899b4e..c2f7bd7 100644 --- a/user/alacritty.nix +++ b/user/alacritty.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, ... }: -let inherit (pkgs.uservars) key theme color accent font; -in { +let + inherit (pkgs.uservars) key theme accent font; + inherit (theme) color; +in +{ config = { programs.alacritty = { enable = true; diff --git a/user/bmenu.nix b/user/bmenu.nix index 464abc9..047da54 100644 --- a/user/bmenu.nix +++ b/user/bmenu.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, inputs, ... }: -let inherit (pkgs.uservars) key theme color accent font; -in { +let + inherit (pkgs.uservars) key theme accent font; + inherit (theme) color; +in +{ # My bemenu wrapper xdg.configFile = { "bmenu.conf".text = '' diff --git a/user/fzf.nix b/user/fzf.nix index 00957ab..b964443 100644 --- a/user/fzf.nix +++ b/user/fzf.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, inputs, ... }: let - inherit (pkgs.uservars) key theme color accent font; + inherit (pkgs.uservars) key theme accent font; + inherit (theme) color; colors = { "bg+" = color.bg_light; diff --git a/user/helix.nix b/user/helix.nix index ee10a3b..3a2c364 100644 --- a/user/helix.nix +++ b/user/helix.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, font, ... }: -let inherit (pkgs.uservars) key theme color accent font editor; -in { +let + inherit (pkgs.uservars) key theme accent font editor; + inherit (theme) color; +in +{ config = { programs.helix = { enable = true; diff --git a/user/kakoune.nix b/user/kakoune.nix index 6407d9c..2699903 100644 --- a/user/kakoune.nix +++ b/user/kakoune.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, font, ... }: -let inherit (pkgs.uservars) key theme color accent font dmenu editor; -in { +let + inherit (pkgs.uservars) key theme accent font dmenu editor; + inherit (theme) color; +in +{ config = { programs.kakoune = { enable = true; diff --git a/user/qutebrowser/default.nix b/user/qutebrowser/default.nix index cefabf1..ca660e0 100644 --- a/user/qutebrowser/default.nix +++ b/user/qutebrowser/default.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, font, ... }: -let inherit (pkgs.uservars) key theme color accent font browser; -in { +let + inherit (pkgs.uservars) key theme accent font browser; + inherit (theme) color; +in +{ config = { programs.qutebrowser = { enable = true; diff --git a/user/rofi.nix b/user/rofi.nix index 5192eea..d9026d2 100644 --- a/user/rofi.nix +++ b/user/rofi.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, font, ... }: -let inherit (pkgs.uservars) key theme color accent font; -in { +let + inherit (pkgs.uservars) key theme accent font; + inherit (theme) color; +in +{ config = { programs.rofi = { enable = true; diff --git a/user/sway.nix b/user/sway.nix index db38e4b..62e14d0 100644 --- a/user/sway.nix +++ b/user/sway.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: let - inherit (pkgs.uservars) key theme color accent font; + inherit (pkgs.uservars) key accent font theme; + inherit (theme) color; color_picker = pkgs.writeShellScript "color_picker" '' grim -g "$(slurp -b aabbcc00 -p)" - | convert - txt:- | diff --git a/user/theme.nix b/user/theme.nix index 5e85427..feb87f3 100644 --- a/user/theme.nix +++ b/user/theme.nix @@ -1,5 +1,9 @@ { config, pkgs, lib, inputs, ... }: -with pkgs.uservars; { +let + inherit (pkgs.uservars) theme font; + inherit (theme) color gtk_theme icon_theme cursor_theme; +in +{ home.pointerCursor = { name = cursor_theme; size = 24; @@ -30,10 +34,10 @@ with pkgs.uservars; { dconf.settings = { "org/gnome/desktop/interface" = { - gtk-theme = pkgs.uservars.gtk_theme; - icon-theme = pkgs.uservars.icon_theme; - cursor-theme = pkgs.uservars.cursor_theme; - color-scheme = "prefer-${pkgs.uservars.color.type}"; + gtk-theme = gtk_theme; + icon-theme = icon_theme; + cursor-theme = cursor_theme; + color-scheme = "prefer-${color.type}"; }; }; diff --git a/user/variables.nix b/user/variables.nix index 10840db..57b08f9 100644 --- a/user/variables.nix +++ b/user/variables.nix @@ -23,6 +23,10 @@ let }; themes = { dark = { + gtk_theme = "Orchis-Red-Dark-Compact"; + icon_theme = "Papirus-Dark"; + cursor_theme = "Bibata-Modern-Classic"; + background = "~/.local/share/backgrounds/nixos-dark-pattern.png"; opacity = 95; opacityHex = "ee"; @@ -50,6 +54,10 @@ let }; }; light = { + gtk_theme = "Orchis-Red-Compact"; + icon_theme = "Papirus"; + cursor_theme = "Bibata-Modern-Classic"; + background = "~/.local/share/backgrounds/nixos-light-pattern.png"; opacity = 95; opacityHex = "ee"; @@ -84,13 +92,8 @@ rec { key = keys.colemak; theme = themes.dark; - color = theme.color; accent = accents.red; - gtk_theme = "Orchis-Red-Dark-Compact"; - icon_theme = "Papirus-Dark"; - cursor_theme = "Bibata-Modern-Classic"; - font = { mono = "Hack Nerd Font"; interface = "Liberation Sans"; diff --git a/user/waybar.nix b/user/waybar.nix index 58cfb72..e29766e 100644 --- a/user/waybar.nix +++ b/user/waybar.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, font, ... }: -let inherit (pkgs.uservars) key theme color accent font; -in { +let + inherit (pkgs.uservars) key theme accent font; + inherit (theme) color; +in +{ config = { programs.waybar = { enable = true; diff --git a/user/zathura.nix b/user/zathura.nix index f52d28f..b95c0d5 100644 --- a/user/zathura.nix +++ b/user/zathura.nix @@ -1,6 +1,9 @@ { config, pkgs, lib, font, ... }: -let inherit (pkgs.uservars) key color accent font; -in { +let + inherit (pkgs.uservars) key accent font theme; + inherit (theme) color; +in +{ config = { programs.zathura.enable = true; programs.zathura.options = {