From 3b2ab08e8408a496e29a6ae7ace1ef8d42b2e03d Mon Sep 17 00:00:00 2001 From: "Reid \"reidlab" Date: Sun, 1 Dec 2024 10:56:03 -0800 Subject: [PATCH] theme improvements --- README.md | 2 +- modules/desktop/nwg-drawer.nix | 4 - modules/desktop/sddm.nix | 9 +- modules/desktop/themes/catppuccin/default.nix | 20 +- .../desktop/themes/catppuccin}/nwg-drawer.css | 7 +- modules/desktop/themes/catppuccin/waybar.css | 4 +- modules/desktop/themes/default.nix | 8 +- packages/catppuccin-sddm-corners/default.nix | 175 ------------------ 8 files changed, 31 insertions(+), 198 deletions(-) rename {config => modules/desktop/themes/catppuccin}/nwg-drawer.css (68%) delete mode 100644 packages/catppuccin-sddm-corners/default.nix diff --git a/README.md b/README.md index b41c30f..6695a68 100755 --- a/README.md +++ b/README.md @@ -18,6 +18,6 @@ each host should have these files: - multi architecture configuration ([nix-systems](https://github.com/nix-systems/nix-systems)?) - divide steam and gamemode? - hidpi and cursor size option ? mostly auto these days though - - better theming for hyprlock, nwg-drawer, rofi + - better theming for hyprlock, rofi - remove battery ui in hyprlock if user isnt on laptop - libinput \ No newline at end of file diff --git a/modules/desktop/nwg-drawer.nix b/modules/desktop/nwg-drawer.nix index 7da4367..e159d6a 100644 --- a/modules/desktop/nwg-drawer.nix +++ b/modules/desktop/nwg-drawer.nix @@ -10,9 +10,5 @@ in { config = mkIf cfg.enable { modules.desktop.execOnStart = [ "${lib.getExe pkgs.nwg-drawer} -r -nofs -nocats -ovl -term wezterm -spacing 15 -fm nautilus" ]; - hm.xdg.configFile."nwg-drawer/drawer.css".text = builtins.concatStringsSep "\n" [ - "@import \"${inputs.waybar-catppuccin}/themes/mocha.css\";" - (lib.readFile ../../config/nwg-drawer.css) - ]; }; } diff --git a/modules/desktop/sddm.nix b/modules/desktop/sddm.nix index 648b6c5..346b701 100644 --- a/modules/desktop/sddm.nix +++ b/modules/desktop/sddm.nix @@ -9,23 +9,22 @@ in { }; config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ + environment.systemPackages = [ config.modules.desktop.themes.sddmTheme.package - config.modules.desktop.themes.cursorTheme.package - libsForQt5.qt5.qtsvg - libsForQt5.qt5.qtgraphicaleffects - libsForQt5.qt5.qtquickcontrols2 + config.modules.desktop.themes.cursorTheme.package # system wide is needed for sddm ]; # why do we need kwin for working hidpi # huh???? services.displayManager.sddm = { enable = true; + package = pkgs.kdePackages.sddm; wayland.enable = config.modules.desktop.envProto == "wayland"; wayland.compositor = "kwin"; theme = config.modules.desktop.themes.sddmTheme.name; settings = { Theme = { CursorTheme = config.modules.desktop.themes.cursorTheme.name; + CursorSize = 24; }; }; }; diff --git a/modules/desktop/themes/catppuccin/default.nix b/modules/desktop/themes/catppuccin/default.nix index 984becd..958d805 100644 --- a/modules/desktop/themes/catppuccin/default.nix +++ b/modules/desktop/themes/catppuccin/default.nix @@ -43,13 +43,13 @@ in { }; sddmTheme = { - name = "catppuccin-sddm-corners"; - package = (pkgs.my.catppuccin-sddm-corners.override { - config.General = { - Background = ../../../../assets/lockscreen.png; - GeneralFontSize = toString config.modules.desktop.fonts.fonts.sansSerif.size; - Font = config.modules.desktop.fonts.fonts.sansSerif.family; - }; + name = "catppuccin-${variant}"; + package = (pkgs.catppuccin-sddm.override { + flavor = variant; + font = config.modules.desktop.fonts.fonts.sansSerif.family; + fontSize = toString config.modules.desktop.fonts.fonts.sansSerif.size; + background = ../../../../assets/lockscreen.png; + loginBackground = true; }); }; @@ -115,6 +115,12 @@ in { wezterm = '' config.color_scheme = 'Catppuccin ${pascalCase variant}' ''; + + nwg-drawer = builtins.concatStringsSep "\n" [ + "@import \"${inputs.waybar-catppuccin}/themes/${variant}.css\";" + #"@define-color accent @${accent};" # gtk already does our styling here + (lib.readFile ./nwg-drawer.css) + ]; }; }; } diff --git a/config/nwg-drawer.css b/modules/desktop/themes/catppuccin/nwg-drawer.css similarity index 68% rename from config/nwg-drawer.css rename to modules/desktop/themes/catppuccin/nwg-drawer.css index ece6db5..1db7cb4 100644 --- a/config/nwg-drawer.css +++ b/modules/desktop/themes/catppuccin/nwg-drawer.css @@ -1,14 +1,15 @@ window { - /*background: @base;*/ background: alpha(@base, 0.3); color: @text; - font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', FontAwesome, Noto Sans CJK; - font-size: 14px; + font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', "Font Awesome 6 Free", "Noto Sans CJK"; + font-size: 13px; font-style: normal; } /* search entry */ entry { + /* we don't actually need to specify accent color here */ + /* this is a gtk app, remember? */ background-color: alpha(@surface0, 0.5); color: @text; } diff --git a/modules/desktop/themes/catppuccin/waybar.css b/modules/desktop/themes/catppuccin/waybar.css index 2ebdb07..3dd9649 100644 --- a/modules/desktop/themes/catppuccin/waybar.css +++ b/modules/desktop/themes/catppuccin/waybar.css @@ -13,8 +13,8 @@ window#waybar { /*background: alpha(@base, 0.6);*/ background: @base; border-radius: 1em; - /*font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', FontAwesome, Noto Sans CJK;*/ - font-family: CozetteVector, monospace, FontAwesome, Noto Sans CJK; + /* font-family: 'Lexica Ultralegible', 'Atkinson Hyperlegible', "Font Awesome 6 Free", "Noto Sans CJK"; */ + font-family: "CozetteVector", monospace, "FontAwesome 6 Free", "Noto Sans CJK"; font-size: 13px; font-style: normal; diff --git a/modules/desktop/themes/default.nix b/modules/desktop/themes/default.nix index 3936375..3f4c216 100644 --- a/modules/desktop/themes/default.nix +++ b/modules/desktop/themes/default.nix @@ -68,6 +68,8 @@ in { rofi = mkOpt (nullOr path) null; wezterm = mkOpt (nullOr str) null; + + nwg-drawer = mkOpt (nullOr str) null; }; config = mkIf (cfg.active != null) { @@ -136,7 +138,8 @@ in { hm.programs.rofi.theme = cfg.rofi; - hm.xdg.configFile ={ + hm.xdg.configFile = { + # kvantum "Kvantum/${cfg.kvantumTheme.name}".source = "${cfg.kvantumTheme.package}/share/Kvantum/${cfg.kvantumTheme.name}"; "Kvantum/kvantum.kvconfig" = { text = '' @@ -144,6 +147,9 @@ in { theme=${cfg.kvantumTheme.name} ''; }; + + # nwg-drawer + "nwg-drawer/drawer.css".text = cfg.nwg-drawer; }; }; } diff --git a/packages/catppuccin-sddm-corners/default.nix b/packages/catppuccin-sddm-corners/default.nix deleted file mode 100644 index d0c15eb..0000000 --- a/packages/catppuccin-sddm-corners/default.nix +++ /dev/null @@ -1,175 +0,0 @@ -{ lib -, stdenvNoCC -, fetchFromGitHub -, writeText -, config ? {} -}: - -let - defaultConfig = { - General = { - ### GENERAL - - # path to the wallpaper. you can drop files in backgrounds/ to use a relative path, or you can just use an absolute path. - Background="backgrounds/flatppuccin_macchiato.png"; - - # the font to use throughout the theme. use the name of the font family. - Font="Liga SFMono Nerd Font"; - - # the distance that stuff should be from the screen edge. - Padding="50"; - - # specify how round corners should be, or set to 0 to disable rounded corners. - CornerRadius="5"; - - # the font size used for everything excluding the date and time. - GeneralFontSize="9"; - - # this allows you to adjust the relative scale of UI elements. you should probably keep the value below 1. - LoginScale="0.175"; - - ### USER PICTURE - - # the width of the outline around the user avatar. set to 0 to disable. - UserPictureBorderWidth="5"; - - # the color of the outline around the user avatar. - UserPictureBorderColor="#c0caf5"; - - # the color of the default, blank avatar. note that this isonly visible when you don't have a custom picture set. - UserPictureColor="#414868"; - - ### TEXT FIELD (USER AND PASSWORD) - - # the color of the text field background for the user and password fields. - TextFieldColor="#414868"; - - # the color of the text inside the user and password fields. - TextFieldTextColor="#c0caf5"; - - # the color of the border around the currently selected text field. - TextFieldHighlightColor="#c0caf5"; - - # the border width of the currently selected text field. set to 0 to disable the border. - TextFieldHighlightWidth="3"; - - # the placeholder text shown in the user field when nothing is typed. - UserFieldBgText="User"; - - # the placeholder text shown in the password field when nothing is typed. - PasswordFieldBgText="Password"; - - ### LOGIN BUTTON - - # the color of the login button text. - LoginButtonTextColor="#414868"; - - # the color of the login button background. - LoginButtonBgColor="#c0caf5"; - - # the text to be displayed on the login button. - LoginButtonText="Login"; - - ### POPUP (POWER, SESSION, AND USER) - - # the background color of the popup. this applies to the power panel, session panel, and user panel. - PopupBgColor="#c0caf5"; - - # the color of the currently selected entry in the popup. this applies to the power panel, session panel, and user panel. - PopupHighlightColor="#414868"; - - # the color of the text for the currently selectedoption. only applies to session and user popups. - PopupHighlightedTextColor="#c0caf5"; - - ### SESSION BUTTON - - # the color of the session button background. - SessionButtonColor="#c0caf5"; - - # the color of the icon inside the session button. - SessionIconColor="#414868"; - - ### POWER BUTTON - - # the color of the power button background. - PowerButtonColor="#c0caf5"; - - # the color of the power button background. - PowerIconColor="#414868"; - - ### DATE - - # the text color of the date. - DateColor="#c0caf5"; - - # the font size of the date. - DateSize="36"; - - # whether the date is bolded. accepts either `true` or `false`. - DateIsBold="false"; - - # whether the date is bolded. accepts either `true` or `false`. - DateOpacity="0.8"; - - # specify the formatting of the date. - DateFormat="dddd, MMMM d"; - - ### TIME - - # the text color of the time. - TimeColor="#c0caf5"; - - # the font size of the time. - TimeSize="48"; - - # whether the time is bolded. accepts either `true` or `false`. - TimeIsBold="true"; - - # the opacity of the time text. set to 1 to disable transparency. - TimeOpacity="0.8"; - - # specify the formatting of the time. - TimeFormat="hh:mm AP"; - }; - }; - mergedConfig = lib.attrsets.recursiveUpdate defaultConfig config; -in stdenvNoCC.mkDerivation { - pname = "catppuccin-sddm-corners"; - version = "unstable-2023-02-17"; - - src = fetchFromGitHub { - owner = "khaneliman"; - repo = "catppuccin-sddm-corners"; - rev = "7b7a86ee9a5a2905e7e6623d2af5922ce890ef79"; - hash = "sha256-sTnt8RarNXz3RmYfmx4rD+nMlY8rr2n0EN3ntPzOurw="; - }; - - dontConfigure = true; - dontBuild = true; - - installPhase = let - configFile = writeText "catppuccin-sddm-corners-theme-conf" (lib.generators.toINI { - # specifies how to format a key/value pair - mkKeyValue = lib.generators.mkKeyValueDefault { - mkValueString = v: ''"${builtins.toString v}"''; - } " = "; - } mergedConfig); - in '' - runHook preInstall - - cp ${configFile} catppuccin/theme.conf - - mkdir -p "$out/share/sddm/themes/" - cp -r catppuccin/ "$out/share/sddm/themes/catppuccin-sddm-corners" - - runHook postInstall - ''; - - meta = { - description = "Soothing pastel theme for SDDM based on corners theme."; - homepage = "https://github.com/khaneliman/sddm-catppuccin-corners"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ khaneliman ]; - platforms = lib.platforms.linux; - }; -}