From 3671401d624c617e9436439a7c6acacab97cab7f Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Fri, 9 Aug 2024 18:16:46 -0400 Subject: [PATCH] theme: overhaul (#78) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add nord css * waybar: workaround to avoid hardcoding rgba colors * alacritty: fix fotn references * kitty: add custom theme * waybar: fmt * aly: remove zed transparency rules * theme: customize adwaita * aly: set colors * desktop: borders 2px -> 4px * mako: increase border size * theme: add teritiary color * hyprland: ignorezero for rofi * theme: remove teritary color option * rofi: dynamic theme * waybar: cleanup * aly: override helix theme to rose-pine-moon * return to old defaults * theme: restore gtk recoloring * waybar: remove transparency * aly/theme: mtch rosé pine font color * theme: add global border-radius options * theme: add borderRadius * mauville: override with rose pine dawn colors * mauville: force override with rose pine dawn colors --- homeManagerModules/apps/alacritty/default.nix | 4 ++-- homeManagerModules/apps/helix/default.nix | 2 +- homeManagerModules/apps/kitty/default.nix | 2 +- homeManagerModules/apps/rofi/default.nix | 15 ++++++------ .../desktop/hyprland/settings.nix | 5 ++-- homeManagerModules/desktop/sway/settings.nix | 6 ++--- homeManagerModules/options.nix | 6 +++++ homeManagerModules/services/mako/default.nix | 4 ++-- .../services/waybar/default.nix | 7 +++--- homeManagerModules/theme.nix | 21 +++++++++++++++- homes/aly/default.nix | 24 +++++++++++++++++++ homes/aly/firefox/default.nix | 20 ++++++++-------- homes/aly/mail/default.nix | 20 ++++++++-------- hosts/mauville/home.nix | 13 +++++++++- 14 files changed, 106 insertions(+), 43 deletions(-) diff --git a/homeManagerModules/apps/alacritty/default.nix b/homeManagerModules/apps/alacritty/default.nix index e148d040..f3474d21 100644 --- a/homeManagerModules/apps/alacritty/default.nix +++ b/homeManagerModules/apps/alacritty/default.nix @@ -22,11 +22,11 @@ in { font = { normal = { - family = cfg.theme.font.monospaceFont.name; + family = cfg.theme.monospaceFont.name; style = "Regular"; }; - size = cfg.theme.font.monospaceFont.size + 1; + size = cfg.theme.monospaceFont.size + 1; }; selection.save_to_clipboard = true; diff --git a/homeManagerModules/apps/helix/default.nix b/homeManagerModules/apps/helix/default.nix index 35ce0dd2..af268565 100644 --- a/homeManagerModules/apps/helix/default.nix +++ b/homeManagerModules/apps/helix/default.nix @@ -68,7 +68,7 @@ }; settings = { - theme = "adwaita-dark"; + theme = lib.mkDefault "adwaita-dark"; editor = { auto-completion = true; auto-format = true; diff --git a/homeManagerModules/apps/kitty/default.nix b/homeManagerModules/apps/kitty/default.nix index 631fc1a7..55905574 100644 --- a/homeManagerModules/apps/kitty/default.nix +++ b/homeManagerModules/apps/kitty/default.nix @@ -22,7 +22,7 @@ in { tab_bar_style = "powerline"; }; - theme = "Adwaita dark"; + theme = lib.mkDefault "Adwaita dark"; }; }; } diff --git a/homeManagerModules/apps/rofi/default.nix b/homeManagerModules/apps/rofi/default.nix index edfbb51c..2e909f9b 100644 --- a/homeManagerModules/apps/rofi/default.nix +++ b/homeManagerModules/apps/rofi/default.nix @@ -70,7 +70,7 @@ in { "rofi/theme.rasi".text = '' * { - selected-normal-foreground: ${cfg.theme.colors.text}; + selected-normal-foreground: ${cfg.theme.colors.secondary}; foreground: ${cfg.theme.colors.text}; normal-foreground: @foreground; alternate-normal-background: transparent; @@ -81,14 +81,14 @@ in { alternate-urgent-background: transparent; active-foreground: ${cfg.theme.colors.primary}CC; lightbg: rgba ( 238, 232, 213, 80 % ); - selected-active-foreground: ${cfg.theme.colors.text}; + selected-active-foreground: ${cfg.theme.colors.secondary}; alternate-active-background: transparent; background: transparent; bordercolor: ${cfg.theme.colors.background}99; alternate-normal-foreground: @foreground; normal-background: transparent; lightfg: ${cfg.theme.colors.primary}CC; - selected-normal-background: ${cfg.theme.colors.primary}; + selected-normal-background: ${cfg.theme.colors.background}; border-color: ${cfg.theme.colors.primary}CC; spacing: 2; separatorcolor: ${cfg.theme.colors.primary}CC; @@ -98,12 +98,13 @@ in { background-color: transparent; alternate-active-foreground: @active-foreground; active-background: transparent; - selected-active-background: ${cfg.theme.colors.primary}; + selected-active-background: ${cfg.theme.colors.background}; } window { - background-color: ${cfg.theme.colors.background}99; - border: 2; - border-radius: 10px; + background-color: ${cfg.theme.colors.background}CC; + border: 4; + border-color: @border-color; + border-radius: ${toString cfg.theme.borderRadius}px; padding: 0; } mainbox { diff --git a/homeManagerModules/desktop/hyprland/settings.nix b/homeManagerModules/desktop/hyprland/settings.nix index bdaabc1e..e198a468 100644 --- a/homeManagerModules/desktop/hyprland/settings.nix +++ b/homeManagerModules/desktop/hyprland/settings.nix @@ -111,11 +111,12 @@ in { "blur,waybar" "ignorezero,gtk-layer-shell" "ignorezero,notifications" + "ignorezero,rofi" "ignorezero,swayosd" "ignorezero,waybar" ]; - rounding = 10; + rounding = cfg.theme.borderRadius; shadow_range = 4; shadow_render_power = 3; }; @@ -148,7 +149,7 @@ in { "col.active_border" = "rgba(${lib.strings.removePrefix "#" cfg.theme.colors.secondary}CC) rgba(${lib.strings.removePrefix "#" cfg.theme.colors.primary}CC) 45deg"; "col.inactive_border" = "rgba(${lib.strings.removePrefix "#" cfg.theme.colors.inactive}99)"; allow_tearing = false; - border_size = 2; + border_size = 4; gaps_in = 5; gaps_out = 6; layout = "dwindle"; diff --git a/homeManagerModules/desktop/sway/settings.nix b/homeManagerModules/desktop/sway/settings.nix index 1bcc57c7..f92a19b1 100644 --- a/homeManagerModules/desktop/sway/settings.nix +++ b/homeManagerModules/desktop/sway/settings.nix @@ -257,15 +257,15 @@ in { bindswitch --reload --locked lid:on output eDP-1 disable bindswitch --reload --locked lid:off output eDP-1 enable - default_border pixel 2 - default_floating_border pixel 2 + default_border pixel 4 + default_floating_border pixel 4 '' + lib.strings.optionalString (config.wayland.windowManager.sway.package == pkgs.swayfx) '' blur enable blur_passes 2 - # corner_radius 10 + # corner_radius ${toString cfg.theme.borderRadius} shadows enable shadows_on_csd enable shadow_color ${cfg.theme.colors.shadow} diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index 08dd4ede..fdcb0995 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -226,6 +226,12 @@ in { type = lib.types.bool; }; + borderRadius = lib.mkOption { + description = "Global border radius."; + default = 10; + type = lib.types.int; + }; + colors = { text = lib.mkOption { description = "Text color."; diff --git a/homeManagerModules/services/mako/default.nix b/homeManagerModules/services/mako/default.nix index 3972fc98..76c43f4e 100644 --- a/homeManagerModules/services/mako/default.nix +++ b/homeManagerModules/services/mako/default.nix @@ -12,8 +12,8 @@ in { anchor = "top-center"; backgroundColor = "${cfg.theme.colors.background}99"; borderColor = "${cfg.theme.colors.primary}CC"; - borderRadius = 10; - borderSize = 2; + borderRadius = cfg.theme.borderRadius; + borderSize = 4; defaultTimeout = 10000; enable = true; font = "${cfg.theme.sansFont.name} Regular ${toString cfg.theme.sansFont.size}"; diff --git a/homeManagerModules/services/waybar/default.nix b/homeManagerModules/services/waybar/default.nix index c3a3c8b2..954f2eac 100644 --- a/homeManagerModules/services/waybar/default.nix +++ b/homeManagerModules/services/waybar/default.nix @@ -314,8 +314,9 @@ in { #submap, #tray, #workspaces { - border-radius: 10px; - background: rgba (36, 36, 36, 0.6); + border-radius: ${toString cfg.theme.borderRadius}px; + background: ${cfg.theme.colors.background}; + opacity: 1.0; margin: 5px 10px 0px 10px; padding: 0px 10px 0px 10px; } @@ -327,7 +328,7 @@ in { #submap, #mode { color: ${cfg.theme.colors.text}; - background: rgba(255, 123, 99, 0.6); + background: rgba(255, 123, 99, 0.8); } ''; diff --git a/homeManagerModules/theme.nix b/homeManagerModules/theme.nix index 23421685..51394bb2 100644 --- a/homeManagerModules/theme.nix +++ b/homeManagerModules/theme.nix @@ -12,8 +12,27 @@ extraCss = '' @define-color accent_bg_color ${cfg.colors.primary}; @define-color accent_color @accent_bg_color; + @define-color accent_fg_color ${cfg.colors.text}; + @define-color window_bg_color ${cfg.colors.background}; + @define-color window_fg_color ${cfg.colors.text}; + @define-color view_bg_color ${cfg.colors.background}; + @define-color view_fg_color @window_fg_color; + @define-color headerbar_bg_color ${cfg.colors.background}; + @define-color headerbar_backdrop_color @window_bg_color; + @define-color headerbar_fg_color @window_fg_color; - ${ + @define-color popover_bg_color ${cfg.colors.background}; + @define-color popover_fg_color @view_fg_color; + @define-color dialog_bg_color @popover_bg_color; + @define-color dialog_fg_color @popover_fg_color; + @define-color card_bg_color @popover_bg_color; + @define-color card_fg_color @window_fg_color; + @define-color sidebar_bg_color @headerbar_bg_color; + @define-color sidebar_fg_color @window_fg_color; + @define-color sidebar_backdrop_color @window_bg_color; + @define-color sidebar_shade_color rgba(0,0,0,0.25); + + ${ lib.strings.optionalString cfg.gtk.hideTitleBar '' diff --git a/homes/aly/default.nix b/homes/aly/default.nix index 4eecd433..fa485e41 100644 --- a/homes/aly/default.nix +++ b/homes/aly/default.nix @@ -61,7 +61,9 @@ in { }; gitui.enable = true; + helix.settings.theme = "rose-pine-moon"; home-manager.enable = true; + kitty.theme = "Rosé Pine Moon"; rbw = { enable = true; @@ -99,12 +101,23 @@ in { zed = { enable = true; package = unstable.zed-editor; + + settings = { + auto_install_extensions = {nord = true;}; + + theme = { + dark = "Rosé Pine Moon"; + light = "Rosé Pine Dawn"; + mode = "system"; + }; + }; }; }; defaultApps = { enable = true; editor = config.ar.home.apps.zed.package; + fileManager = pkgs.xfce.thunar; }; services = { @@ -114,6 +127,17 @@ in { theme = { enable = true; + borderRadius = 0; + + colors = { + text = "#e0def4"; + background = "#2a273f"; + primary = "#3e8fb0"; + secondary = "#f6c177"; + inactive = "#393552"; + shadow = "#232136"; + }; + wallpaper = "${config.xdg.dataHome}/backgrounds/wallhaven-6d7xmx.jpg"; }; }; diff --git a/homes/aly/firefox/default.nix b/homes/aly/firefox/default.nix index 1f8cffcd..c12428f0 100644 --- a/homes/aly/firefox/default.nix +++ b/homes/aly/firefox/default.nix @@ -3,16 +3,16 @@ pkgs, ... }: { - home.file = let - source = builtins.fetchGit { - url = "https://github.com/rafaelmardojai/firefox-gnome-theme.git"; - rev = "fb5b578a4f49ae8705e5fea0419242ed1b8dba70"; - ref = "master"; - }; - in { - ".mozilla/firefox/default/chrome".source = source; - ".mozilla/firefox/work/chrome".source = source; - }; + # home.file = let + # source = builtins.fetchGit { + # url = "https://github.com/rafaelmardojai/firefox-gnome-theme.git"; + # rev = "fb5b578a4f49ae8705e5fea0419242ed1b8dba70"; + # ref = "master"; + # }; + # in { + # ".mozilla/firefox/default/chrome".source = source; + # ".mozilla/firefox/work/chrome".source = source; + # }; programs.firefox = { enable = true; diff --git a/homes/aly/mail/default.nix b/homes/aly/mail/default.nix index 23b52fad..a6672793 100644 --- a/homes/aly/mail/default.nix +++ b/homes/aly/mail/default.nix @@ -84,16 +84,16 @@ in { }; }; - home.file = let - source = builtins.fetchGit { - url = "https://github.com/rafaelmardojai/thunderbird-gnome-theme.git"; - rev = "628fcccb7788e3e0ad34f67114f563c87ac8c1dc"; - ref = "main"; - }; - in { - ".thunderbird/default/chrome".source = source; - ".thunderbird/work/chrome".source = source; - }; + # home.file = let + # source = builtins.fetchGit { + # url = "https://github.com/rafaelmardojai/thunderbird-gnome-theme.git"; + # rev = "628fcccb7788e3e0ad34f67114f563c87ac8c1dc"; + # ref = "main"; + # }; + # in { + # ".thunderbird/default/chrome".source = source; + # ".thunderbird/work/chrome".source = source; + # }; programs = { himalaya.enable = true; diff --git a/hosts/mauville/home.nix b/hosts/mauville/home.nix index 770e974c..da971170 100644 --- a/hosts/mauville/home.nix +++ b/hosts/mauville/home.nix @@ -16,7 +16,18 @@ hyprland.monitors = ["desc:LG Electronics LG ULTRAWIDE 311NTAB5M720,preferred,auto,1.25,vrr,2"]; }; - theme.darkMode = false; + theme = { + colors = lib.mkForce { + text = "#575279"; + background = "#fffaf3"; + primary = "#286983"; + secondary = "#ea9d34"; + inactive = "#393552"; + shadow = "#232136"; + }; + + darkMode = false; + }; }; } ];