From b8783445661e571ac40ba2b7e047d37bac9fb15a Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Fri, 28 Mar 2025 18:31:21 +0100 Subject: [PATCH] some more color management --- README.md | 5 ++ .../hypr/hyprland-customization.nix | 5 ++ modules/home-manager/kitty.nix | 4 + modules/home-manager/stylix.nix | 11 +-- modules/home-manager/wofi.nix | 83 +++++++++++++++---- modules/nixos/nvidia.nix | 4 - 6 files changed, 87 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 05fa342..246f540 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ TODO - disable root user I install with --no-root-passwd and set users.mutableUsers = false in configuration.nix ``` +## TODO +- Have a wofi power menu with https://github.com/RiteshChepuri/wofi-scripts/blob/main/wofi-power-menu + + + ## Inspirations - https://github.com/the-nix-way/dev-templates diff --git a/modules/home-manager/hypr/hyprland-customization.nix b/modules/home-manager/hypr/hyprland-customization.nix index 07bbf61..ea437cb 100644 --- a/modules/home-manager/hypr/hyprland-customization.nix +++ b/modules/home-manager/hypr/hyprland-customization.nix @@ -8,9 +8,14 @@ pkgs.brightnessctl pkgs.cliphist pkgs.wl-clipboard + pkgs.gcr # Provides org.gnome.keyring.SystemPrompter ]; + # Also use gnome keyring + services.gnome-keyring.enable = true; + + wayland.windowManager.hyprland = { enable = true; systemd.enable = true; diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix index 7a7acc3..17b010a 100644 --- a/modules/home-manager/kitty.nix +++ b/modules/home-manager/kitty.nix @@ -7,6 +7,8 @@ in enable = true; shellIntegration.enableFishIntegration = true; settings = { + + # # import the colors from the stylix theme, but keep the background black # color0 = stylix.stylix.base16Scheme.base00; # color8 = stylix.stylix.base16Scheme.base08; @@ -37,6 +39,8 @@ in background = "#000000"; + font_family = stylix.stylix.fonts.monospace.name; + font_size = stylix.stylix.fonts.sizes.terminal; confirm_os_window_close = 0; enable_audio_bell = false; cursor_trail = 3; diff --git a/modules/home-manager/stylix.nix b/modules/home-manager/stylix.nix index e6e439b..4a27a3c 100644 --- a/modules/home-manager/stylix.nix +++ b/modules/home-manager/stylix.nix @@ -9,7 +9,7 @@ cursor = { package = pkgs.apple-cursor; name = "macOS"; - size = 32; + size = 35; }; iconTheme = { @@ -44,10 +44,10 @@ }; sizes = { - applications = 14; - desktop = 14; + applications = 15; + desktop = 15; popups = 12; - terminal = 14; + terminal = 15; }; }; @@ -84,9 +84,10 @@ stylix.targets = { hyprpaper.enable = true; hyprlock.enable = true; - wofi.enable = true; + gnome.enable = true; # disabled because they overwrite too many settings + # wofi.enable = true; # vscode.enable = true; # waybar.enable = true; # kitty.enable = true; diff --git a/modules/home-manager/wofi.nix b/modules/home-manager/wofi.nix index 41ccd09..13b1290 100644 --- a/modules/home-manager/wofi.nix +++ b/modules/home-manager/wofi.nix @@ -1,11 +1,7 @@ { config, pkgs, lib, ... }: let - accent = "#ffffff"; - background = "#000000"; - background-alt = "#000000"; - foreground = "##ffffff"; - rounding = 5; - font-size = 25; + stylix = import ./stylix.nix { inherit pkgs; }; + in { home.packages = with pkgs; [ wofi-emoji ]; @@ -14,31 +10,86 @@ in { enable = true; settings = { - allow_markup = true; - width = 500; - height = 400; + # global layout + width = "50%"; + height = "50%"; + orientation = "vertical"; + hide_scroll = true; + line_wrap = "off"; + dynamic_lines = true; + + # search behaviour + matching = "fuzzy"; + single_click = true; + + show = "drun"; prompt = "Launch..."; - normal_window = true; + # normal_window = true; layer = "top"; term = "foot"; - orientation = "vertical"; halign = "fill"; - line_wrap = "off"; - dynamic_lines = false; + + # Rich rendering + allow_markup = true; allow_images = true; image_size = 24; + + exec_search = false; hide_search = false; parse_search = false; insensitive = true; - hide_scroll = true; no_actions = true; - sort_order = "default"; - gtk_dark = true; + + filter_rate = 100; key_expand = "Tab"; key_exit = "Escape"; + }; + + + style = '' + * { + font-family: ${stylix.stylix.fonts.sansSerif.name}; + font-size: ${builtins.toString (stylix.stylix.fonts.sizes.applications + 10)}px; + color: ${stylix.stylix.base16Scheme.base04}; + background: transparent; + } + + #window { + background: rgba(41, 46, 66, 0.5); + margin: auto; + padding: 10px; + } + + #input { + padding: 10px; + margin-bottom: 10px; + border-radius: 15px; + } + + #outer-box { + padding: 20px; + } + + #img { + margin-right: 6px; + } + + #entry { + padding: 10px; + border-radius: 15px; + } + + #entry:selected { + background-color: #2e3440; + } + + #text { + margin: 2px; + } + ''; }; } diff --git a/modules/nixos/nvidia.nix b/modules/nixos/nvidia.nix index c47b220..fc45b6f 100644 --- a/modules/nixos/nvidia.nix +++ b/modules/nixos/nvidia.nix @@ -69,7 +69,3 @@ boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; } - - -# Warning: used to have -# lib.mkdDefault