From 48aaa758bad4e5b3fbf9b348e25201bed427e4e9 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sun, 16 Mar 2025 17:02:18 +0100 Subject: [PATCH] rofi theme --- .config/rofi/arc_dark_colors.rasi | 4 -- .config/rofi/rofidmenu.rasi | 6 +- home-manager/hyprland/hyprland-settings.nix | 2 + home-manager/hyprland/waybar.nix | 2 +- home-manager/rofi.nix | 9 --- home-manager/rofi/default.nix | 73 +++++++++++++++++++++ home-manager/rofi/rofi_stylix_colors.rasi | 30 +++++++++ modules/graphical/hyprland.nix | 1 + modules/graphical/stylix.nix | 15 ++++- modules/themes/tsukasa.nix | 21 ++++++ systems/pc/configuration.nix | 1 + users/kopatz/home.nix | 2 +- 12 files changed, 146 insertions(+), 20 deletions(-) delete mode 100644 home-manager/rofi.nix create mode 100644 home-manager/rofi/default.nix create mode 100644 home-manager/rofi/rofi_stylix_colors.rasi create mode 100644 modules/themes/tsukasa.nix diff --git a/.config/rofi/arc_dark_colors.rasi b/.config/rofi/arc_dark_colors.rasi index 6918845..abc9c8f 100644 --- a/.config/rofi/arc_dark_colors.rasi +++ b/.config/rofi/arc_dark_colors.rasi @@ -1,7 +1,3 @@ -/******************************************************* - * ROFI Arc Dark colors for EndeavourOS - * Maintainer: joekamprad [joekamprad //a_t// endeavouros.com] - *******************************************************/ * { selected-normal-foreground: rgba ( 249, 249, 249, 100 % ); foreground: rgba ( 196, 203, 212, 100 % ); diff --git a/.config/rofi/rofidmenu.rasi b/.config/rofi/rofidmenu.rasi index 298bf67..da1c06a 100644 --- a/.config/rofi/rofidmenu.rasi +++ b/.config/rofi/rofidmenu.rasi @@ -13,12 +13,14 @@ configuration { sidebar-mode: false; } -@import "~/.config/rofi/arc_dark_transparent_colors.rasi" +/*@import "~/.config/rofi/arc_dark_transparent_colors.rasi"*/ +@import "~/.config/rofi/rofi_stylix_colors.rasi" window { background-color: @background; border: 2; - border-color: #585b70; + /*border-color: #585b70;*/ + border-color: @border-color; padding: 30; } listview { diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index d25a6c8..03b40ab 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -289,6 +289,8 @@ in { "stayfocused,class:(steam_app_107410)" "immediate, class:^tetrio-desktop$" "opacity 0.85, class:thunar" + "opacity 0.85, class:discord" + "opacity 0.1, title:cava" ]; exec-once = [ diff --git a/home-manager/hyprland/waybar.nix b/home-manager/hyprland/waybar.nix index 4a3c201..c49f617 100644 --- a/home-manager/hyprland/waybar.nix +++ b/home-manager/hyprland/waybar.nix @@ -38,7 +38,7 @@ in { modules-right = [ "group/stats" "group/other" ]; "group/stats" = { "orientation" = "horizontal"; - "modules" = [ "network" "cpu" "memory" "disk" "temperature" ] + "modules" = [ "network" "cpu" "memory" "temperature" ] ++ lib.optionals osConfig.custom.hardware.nvidia.enable [ "custom/nvidia" ] ++ lib.optionals osConfig.custom.hardware.amd-gpu.enable [ "custom/amd-gpu" ]; }; diff --git a/home-manager/rofi.nix b/home-manager/rofi.nix deleted file mode 100644 index 546fd30..0000000 --- a/home-manager/rofi.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, inputs, ...}: -{ - home.file.".config/rofi" = { - enable = true; - recursive = true; - source = ../.config/rofi; - target = ".config/rofi"; - }; -} diff --git a/home-manager/rofi/default.nix b/home-manager/rofi/default.nix new file mode 100644 index 0000000..1b7a874 --- /dev/null +++ b/home-manager/rofi/default.nix @@ -0,0 +1,73 @@ +{ config, pkgs, inputs, lib, ... }: +with config.stylix.fonts; +let + mkLiteral = name: "${name}"; + mkRgba = opacity: color: + let + c = config.lib.stylix.colors; + r = c."${color}-rgb-r"; + g = c."${color}-rgb-g"; + b = c."${color}-rgb-b"; + in "rgba ( ${r}, ${g}, ${b}, ${opacity} % )"; + mkRgb = mkRgba "100"; + rofiOpacity = + builtins.toString (builtins.ceil (config.stylix.opacity.popups * 100)); + rofiTheme = { + background = mkRgba rofiOpacity "base00"; + lightbg = mkRgba rofiOpacity "base01"; + red = mkRgba rofiOpacity "base08"; + blue = mkRgba rofiOpacity "base0D"; + lightfg = mkRgba rofiOpacity "base06"; + foreground = mkRgba rofiOpacity "base05"; + transparent = mkRgba "0" "base00"; + + background-color = mkLiteral "rgba ( 0, 0, 0, 0 % )"; + separatorcolor = mkLiteral "@transparent"; + border-color = mkLiteral "@foreground"; + selected-normal-foreground = mkLiteral "@foreground"; + selected-normal-background = mkLiteral "@lightbg"; + selected-active-foreground = mkLiteral "@background"; + selected-active-background = mkLiteral "@blue"; + selected-urgent-foreground = mkLiteral "@background"; + selected-urgent-background = mkLiteral "@red"; + normal-foreground = mkLiteral "@foreground"; + normal-background = mkLiteral "@transparent"; + active-foreground = mkLiteral "@blue"; + active-background = mkLiteral "@background"; + urgent-foreground = mkLiteral "@red"; + urgent-background = mkLiteral "@background"; + alternate-normal-foreground = mkLiteral "@foreground"; + alternate-normal-background = mkLiteral "@transparent"; + alternate-active-foreground = mkLiteral "@blue"; + alternate-active-background = mkLiteral "@background"; + alternate-urgent-foreground = mkLiteral "@red"; + alternate-urgent-background = mkLiteral "@background"; + + # Text Colors + base-text = mkRgb "base05"; + selected-normal-text = mkRgb "base01"; + selected-active-text = mkRgb "base00"; + selected-urgent-text = mkRgb "base00"; + normal-text = mkRgb "base05"; + active-text = mkRgb "base0D"; + urgent-text = mkRgb "base08"; + alternate-normal-text = mkRgb "base05"; + alternate-active-text = mkRgb "base0D"; + alternate-urgent-text = mkRgb "base08"; + }; +in { + home.file.".config/rofi" = { + enable = true; + recursive = true; + source = ../../.config/rofi; + }; + + home.file.".config/rofi/rofi_stylix_colors.rasi" = { + enable = true; + text = '' + * { + ${builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name}: ${value};") rofiTheme)} + } + ''; + }; +} diff --git a/home-manager/rofi/rofi_stylix_colors.rasi b/home-manager/rofi/rofi_stylix_colors.rasi new file mode 100644 index 0000000..1e8b3f0 --- /dev/null +++ b/home-manager/rofi/rofi_stylix_colors.rasi @@ -0,0 +1,30 @@ +* { + selected-normal-foreground: rgba ( 249, 249, 249, 100 % ); + foreground: #@FOREGROUND@; + normal-foreground: @foreground; + alternate-normal-background: rgba ( 64, 69, 82, 59 % ); + red: rgba ( 220, 50, 47, 100 % ); + selected-urgent-foreground: rgba ( 249, 249, 249, 100 % ); + blue: rgba ( 38, 139, 210, 100 % ); + urgent-foreground: rgba ( 204, 102, 102, 100 % ); + alternate-urgent-background: rgba ( 75, 81, 96, 90 % ); + active-foreground: rgba ( 101, 172, 255, 100 % ); + lightbg: rgba ( 238, 232, 213, 100 % ); + selected-active-foreground: rgba ( 249, 249, 249, 100 % ); + alternate-active-background: rgba ( 75, 81, 96, 89 % ); + background: rgba ( 45, 48, 59, 95 % ); + alternate-normal-foreground: @foreground; + normal-background: @background; + lightfg: rgba ( 88, 104, 117, 100 % ); + selected-normal-background: rgba ( 64, 132, 214, 100 % ); + border-color: rgba ( 124, 131, 137, 100 % ); + spacing: 2; + separatorcolor: rgba ( 29, 31, 33, 100 % ); + urgent-background: rgba ( 29, 31, 33, 17 % ); + selected-urgent-background: rgba ( 165, 66, 66, 100 % ); + alternate-urgent-foreground: @urgent-foreground; + background-color: rgba ( 0, 0, 0, 0 % ); + alternate-active-foreground: @active-foreground; + active-background: rgba ( 29, 31, 33, 17 % ); + selected-active-background: rgba ( 68, 145, 237, 100 % ); +} diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 1a544be..b2f8a74 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -45,6 +45,7 @@ in { networkmanagerapplet wayland wl-clipboard + cava dex # starts applications according to .desktop files #qt5.qtwayland #qt6.qmake diff --git a/modules/graphical/stylix.nix b/modules/graphical/stylix.nix index 7ed65d0..39b3da5 100644 --- a/modules/graphical/stylix.nix +++ b/modules/graphical/stylix.nix @@ -10,6 +10,13 @@ in { The wallpaper to use. ''; }; + base16Scheme = mkOption { + type = with lib.types; nullOr (oneOf [ path lines attrs ]); + default = null; + description = '' + The base16 scheme to use. + ''; + }; override = mkOption { type = types.attrs; #default = {}; @@ -44,6 +51,7 @@ in { autoEnable = lib.mkForce true; polarity = "dark"; image = cfg.image; + base16Scheme = cfg.base16Scheme; override = cfg.override; #base16Scheme = ../../home-manager/themes/yorha/scheme.yml; #base16Scheme = @@ -54,9 +62,10 @@ in { package = pkgs.libsForQt5.breeze-gtk; }; opacity = { - applications = 0.7; - desktop = 0.7; - terminal = 0.7; + applications = 0.85; + desktop = 0.85; + terminal = 0.85; + popups = 0.85; }; #targets.hyprland.enable = false; does not exist in the MR version yet fonts = { diff --git a/modules/themes/tsukasa.nix b/modules/themes/tsukasa.nix new file mode 100644 index 0000000..73bd7a4 --- /dev/null +++ b/modules/themes/tsukasa.nix @@ -0,0 +1,21 @@ +{ + "base00"= "201a1e"; + "base01"= "5c4133"; + "base02"= "83644f"; + "base03"= "c3955f"; + "base04"= "dab353"; + "base05"= "f4dfb4"; + "base06"= "fef1de"; + "base07"= "fef1de"; + "base08"= "ed8796"; + "base09"= "f5a97f"; + "base0A"= "eed49f"; + "base0B"= "a6da95"; + "base0C"= "8bd5ca"; + "base0D"= "8aadf4"; + "base0E"= "c6a0f6"; + "base0F"= "f0c6c6"; + "author"= "Stylix"; + "scheme"= "Stylix"; + "slug"= "stylix"; +} diff --git a/systems/pc/configuration.nix b/systems/pc/configuration.nix index 813497b..8969e83 100644 --- a/systems/pc/configuration.nix +++ b/systems/pc/configuration.nix @@ -85,6 +85,7 @@ basics.enable = true; stylix = { enable = true; + base16Scheme = import ../../modules/themes/tsukasa.nix; image = ../../tsukasa.jpg; }; }; diff --git a/users/kopatz/home.nix b/users/kopatz/home.nix index 93ea09e..dffb69b 100644 --- a/users/kopatz/home.nix +++ b/users/kopatz/home.nix @@ -23,7 +23,7 @@ ../../home-manager/kitty.nix #../../home-manager/lf.nix broken atm ../../home-manager/nixvim - ../../home-manager/rofi.nix + ../../home-manager/rofi ../../home-manager/dunst.nix ../../home-manager/opensnitch-ui.nix #../../home-manager/theme.nix