From 60d177ba39adb4fb82082279afd3ac8ffadffb37 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:38:53 +0100 Subject: [PATCH] Init text color on wallpaper Former-commit-id: c0dfbe8249e16db8c8bf0f14ec2eea23cb96a285 --- home/system/hyprlock/default.nix | 2 +- home/system/hyprpanel/default.nix | 6 +- nixos/sddm.nix | 15 ++++ themes/nixy.nix | 122 +++++++++++++++--------------- 4 files changed, 81 insertions(+), 64 deletions(-) diff --git a/home/system/hyprlock/default.nix b/home/system/hyprlock/default.nix index d0fcf0e..80f1fab 100644 --- a/home/system/hyprlock/default.nix +++ b/home/system/hyprlock/default.nix @@ -1,7 +1,7 @@ # Hyprlock is a lockscreen for Hyprland { config, lib, ... }: let - foreground = "rgba(26, 22, 23, 0.70)"; + foreground = "rgba(${config.theme.textColorOnWallpaper}ee)"; font = config.stylix.fonts.serif.name; in { programs.hyprlock = { diff --git a/home/system/hyprpanel/default.nix b/home/system/hyprpanel/default.nix index f1cb0d4..f9d7f9d 100644 --- a/home/system/hyprpanel/default.nix +++ b/home/system/hyprpanel/default.nix @@ -9,6 +9,7 @@ let background = "#${config.lib.stylix.colors.base00}"; background-alt = "#${config.lib.stylix.colors.base01}"; foreground = "#${config.lib.stylix.colors.base05}"; + foregroundOnWallpaper = "#${config.theme.textColorOnWallpaper}"; font = "${config.stylix.fonts.serif.name}"; fontSize = "${toString config.stylix.fonts.sizes.desktop}"; @@ -146,7 +147,10 @@ in { + (if transparentButtons && transparent then "00" else "")}"; "theme.bar.buttons.style" = "default"; "theme.bar.buttons.monochrome" = true; - "theme.bar.buttons.text" = "${foreground}"; + "theme.bar.buttons.text" = if transparent && transparentButtons then + "${foregroundOnWallpaper}" + else + "${foreground}"; "theme.bar.buttons.background" = "${(if transparent then background else background-alt) + (if transparentButtons then "00" else "")}"; diff --git a/nixos/sddm.nix b/nixos/sddm.nix index a3426f4..02d1239 100644 --- a/nixos/sddm.nix +++ b/nixos/sddm.nix @@ -1,11 +1,26 @@ { pkgs, inputs, config, lib, ... }: let + foreground = config.theme.textColorOnWallpaper; sddm-astronaut = pkgs.sddm-astronaut.override { embeddedTheme = "pixel_sakura"; themeConfig = if lib.hasSuffix "sakura_static.png" config.stylix.image then { } else { Background = "${toString config.stylix.image}"; + HeaderTextColor = "#${foreground}"; + DateTextColor = "#${foreground}"; + TimeTextColor = "#${foreground}"; + LoginFieldTextColor = "#${foreground}"; + PasswordFieldTextColor = "#${foreground}"; + UserIconColor = "#${foreground}"; + PasswordIconColor = "#${foreground}"; + WarningColor = "#${foreground}"; + LoginButtonBackgroundColor = "#${foreground}"; + SystemButtonsIconsColor = "#${foreground}"; + SessionButtonTextColor = "#${foreground}"; + VirtualKeyboardButtonTextColor = "#${foreground}"; + DropdownBackgroundColor = "#${foreground}"; + HighlightBackgroundColor = "#${foreground}"; }; }; in { diff --git a/themes/nixy.nix b/themes/nixy.nix index 165f63e..771627b 100644 --- a/themes/nixy.nix +++ b/themes/nixy.nix @@ -12,6 +12,8 @@ border-size = 3; animation-speed = "medium"; # "fast" | "medium" | "slow" fetch = "none"; # "nerdfetch" | "neofetch" | "pfetch" | "none" + textColorOnWallpaper = + config.lib.stylix.colors.base06; # Color of the text displayed on the wallpaper (Lockscreen, display manager, ...) bar = { # Hyprpanel position = "top"; # "top" | "bottom" @@ -23,73 +25,69 @@ description = "Theme configuration options"; }; - config = { - stylix = { - enable = true; + config.stylix = { + enable = true; - # See https://tinted-theming.github.io/tinted-gallery/ for more schemes - base16Scheme = { - base00 = "0c0e0f"; # Default Background - base01 = - "202324"; # Lighter Background (Used for status bars, line number and folding marks) - base02 = "313244"; # Selection Background - base03 = "45475a"; # Comments, Invisibles, Line Highlighting - base04 = "585b70"; # Dark Foreground (Used for status bars) - base05 = "cdd6f4"; # Default Foreground, Caret, Delimiters, Operators - base06 = "f5e0dc"; # Light Foreground (Not often used) - base07 = "b4befe"; # Light Background (Not often used) - base08 = - "f38ba8"; # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted - base09 = - "fab387"; # Integers, Boolean, Constants, XML Attributes, Markup Link Url - base0A = "f9e2af"; # Classes, Markup Bold, Search Text Background - base0B = - "a6e3a1"; # Strings, Inherited Class, Markup Code, Diff Inserted - base0C = - "94e2d5"; # Support, Regular Expressions, Escape Characters, Markup Quotes - base0D = - "89b4fa"; # Functions, Methods, Attribute IDs, Headings, Accent color - base0E = - "cba6f7"; # Keywords, Storage, Selector, Markup Italic, Diff Changed - base0F = - "f2cdcd"; # Deprecated, Opening/Closing Embedded Language Tags, e.g. + # See https://tinted-theming.github.io/tinted-gallery/ for more schemes + base16Scheme = { + base00 = "0c0e0f"; # Default Background + base01 = + "202324"; # Lighter Background (Used for status bars, line number and folding marks) + base02 = "313244"; # Selection Background + base03 = "45475a"; # Comments, Invisibles, Line Highlighting + base04 = "585b70"; # Dark Foreground (Used for status bars) + base05 = "cdd6f4"; # Default Foreground, Caret, Delimiters, Operators + base06 = "f5e0dc"; # Light Foreground (Not often used) + base07 = "b4befe"; # Light Background (Not often used) + base08 = + "f38ba8"; # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + base09 = + "fab387"; # Integers, Boolean, Constants, XML Attributes, Markup Link Url + base0A = "f9e2af"; # Classes, Markup Bold, Search Text Background + base0B = "a6e3a1"; # Strings, Inherited Class, Markup Code, Diff Inserted + base0C = + "94e2d5"; # Support, Regular Expressions, Escape Characters, Markup Quotes + base0D = + "89b4fa"; # Functions, Methods, Attribute IDs, Headings, Accent color + base0E = + "cba6f7"; # Keywords, Storage, Selector, Markup Italic, Diff Changed + base0F = + "f2cdcd"; # Deprecated, Opening/Closing Embedded Language Tags, e.g. + }; + + cursor = { + name = "phinger-cursors-light"; + package = pkgs.phinger-cursors; + size = 20; + }; + + fonts = { + monospace = { + package = pkgs.nerd-fonts.jetbrains-mono; + name = "JetBrains Mono Nerd Font"; }; - - cursor = { - name = "phinger-cursors-light"; - package = pkgs.phinger-cursors; - size = 20; + sansSerif = { + package = pkgs.source-sans-pro; + name = "Source Sans Pro"; }; - - fonts = { - monospace = { - package = pkgs.nerd-fonts.jetbrains-mono; - name = "JetBrains Mono Nerd Font"; - }; - sansSerif = { - package = pkgs.source-sans-pro; - name = "Source Sans Pro"; - }; - serif = config.stylix.fonts.sansSerif; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; - sizes = { - applications = 13; - desktop = 13; - popups = 13; - terminal = 13; - }; + serif = config.stylix.fonts.sansSerif; + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; }; - - polarity = "dark"; - image = pkgs.fetchurl { - url = - "https://raw.githubusercontent.com/AlexandrosLiaskos/Awesome_Wallpapers/main/images/pastel-window.png"; - sha256 = "sha256-KMYVs4hSs+e66q4o15aVJ4mbTMDqIKEH4tBv9zZ7J2o="; + sizes = { + applications = 13; + desktop = 13; + popups = 13; + terminal = 13; }; }; - }; + polarity = "dark"; + image = pkgs.fetchurl { + url = + "https://raw.githubusercontent.com/AlexandrosLiaskos/Awesome_Wallpapers/main/images/pastel-window.png"; + sha256 = "sha256-KMYVs4hSs+e66q4o15aVJ4mbTMDqIKEH4tBv9zZ7J2o="; + }; + }; }