Easier way to manage hyprpanel theme

This commit is contained in:
Javier Feliz 2025-09-01 13:17:14 -04:00
parent 24a8ccfc8f
commit 832b2056aa
9 changed files with 512 additions and 41 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

454
flake.lock generated
View File

@ -1,5 +1,38 @@
{
"nodes": {
"aquamarine": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1755946532,
"narHash": "sha256-POePremlUY5GyA1zfbtic6XLxDaQcqHN6l+bIxdT5gc=",
"owner": "hyprwm",
"repo": "aquamarine",
"rev": "81584dae2df6ac79f6b6dae0ecb7705e95129ada",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "aquamarine",
"type": "github"
}
},
"base16": {
"inputs": {
"fromYaml": "fromYaml"
@ -116,6 +149,22 @@
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -196,7 +245,7 @@
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
"systems": "systems_3"
},
"locked": {
"lastModified": 1705309234,
@ -230,8 +279,8 @@
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"flake-compat": "flake-compat_3",
"gitignore": "gitignore_2",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
@ -252,6 +301,28 @@
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"hyprland",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
@ -332,9 +403,218 @@
"type": "github"
}
},
"hyprcursor": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1753964049,
"narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprcursor",
"type": "github"
}
},
"hyprgraphics": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1755678602,
"narHash": "sha256-uEC5O/NIUNs1zmc1aH1+G3GRACbODjk2iS0ET5hXtuk=",
"owner": "hyprwm",
"repo": "hyprgraphics",
"rev": "157cc52065a104fc3b8fa542ae648b992421d1c7",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprgraphics",
"type": "github"
}
},
"hyprland": {
"inputs": {
"aquamarine": "aquamarine",
"hyprcursor": "hyprcursor",
"hyprgraphics": "hyprgraphics",
"hyprland-protocols": "hyprland-protocols",
"hyprland-qtutils": "hyprland-qtutils",
"hyprlang": "hyprlang",
"hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks",
"systems": "systems",
"xdph": "xdph"
},
"locked": {
"lastModified": 1756656879,
"narHash": "sha256-QCNUXw1J0BaykSKSb9jp5h1v4YVBLVcekhrxnivlgY4=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "5bb8adbc3228901d199e8d22d6f712bd1d7d4e15",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1749046714,
"narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprland-qt-support": {
"inputs": {
"hyprlang": [
"hyprland",
"hyprland-qtutils",
"hyprlang"
],
"nixpkgs": [
"hyprland",
"hyprland-qtutils",
"nixpkgs"
],
"systems": [
"hyprland",
"hyprland-qtutils",
"systems"
]
},
"locked": {
"lastModified": 1749154592,
"narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=",
"owner": "hyprwm",
"repo": "hyprland-qt-support",
"rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-qt-support",
"type": "github"
}
},
"hyprland-qtutils": {
"inputs": {
"hyprland-qt-support": "hyprland-qt-support",
"hyprlang": [
"hyprland",
"hyprlang"
],
"hyprutils": [
"hyprland",
"hyprland-qtutils",
"hyprlang",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1753819801,
"narHash": "sha256-tHe6XeNeVeKapkNM3tcjW4RuD+tB2iwwoogWJOtsqTI=",
"owner": "hyprwm",
"repo": "hyprland-qtutils",
"rev": "b308a818b9dcaa7ab8ccab891c1b84ebde2152bc",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-qtutils",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"hyprutils": [
"hyprland",
"hyprutils"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1753622892,
"narHash": "sha256-0K+A+gmOI8IklSg5It1nyRNv0kCNL51duwnhUO/B8JA=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "23f0debd2003f17bd65f851cd3f930cff8a8c809",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprshell": {
"inputs": {
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1754802608,
@ -350,6 +630,56 @@
"url": "https://gitgud.foo/thegrind/hypr-shell.git"
}
},
"hyprutils": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1756117388,
"narHash": "sha256-oRDel6pNl/T2tI+nc/USU9ZP9w08dxtl7hiZxa0C/Wc=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "b2ae3204845f5f2f79b4703b441252d8ad2ecfd0",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprutils",
"type": "github"
}
},
"hyprwayland-scanner": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1755184602,
"narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"type": "github"
}
},
"my-assets": {
"flake": false,
"locked": {
@ -364,12 +694,12 @@
},
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"treefmt-nix": "treefmt-nix"
},
"locked": {
@ -403,6 +733,22 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1756266583,
"narHash": "sha256-cr748nSmpfvnhqSXPiCfUPxRz2FJnvf/RjJGvFfaCsM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8a6d5427d99ec71c64f0b93d45778c889005d9c2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1754725699,
"narHash": "sha256-iAcj9T/Y+3DBy2J0N+yF9XQQQ8IEb5swLFzs23CdP88=",
@ -418,7 +764,7 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs_3": {
"locked": {
"lastModified": 1754800730,
"narHash": "sha256-HfVZCXic9XLBgybP0318ym3cDnGwBs/+H5MgxFVYF4I=",
@ -434,7 +780,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1754498491,
"narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=",
@ -450,7 +796,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1708161998,
"narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=",
@ -491,13 +837,37 @@
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1755960406,
"narHash": "sha256-RF7j6C1TmSTK9tYWO6CdEMtg6XZaUKcvZwOCD2SICZs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "e891a93b193fcaf2fc8012d890dc7f0befe86ec2",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"hyprland": "hyprland",
"hyprshell": "hyprshell",
"my-assets": "my-assets",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_3",
"nixpkgs": "nixpkgs_4",
"stylix": "stylix",
"zig": "zig"
}
@ -515,7 +885,7 @@
"nixpkgs"
],
"nur": "nur",
"systems": "systems",
"systems": "systems_2",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
@ -537,6 +907,21 @@
}
},
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -551,7 +936,7 @@
"type": "github"
}
},
"systems_2": {
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -668,11 +1053,52 @@
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"hyprlang": [
"hyprland",
"hyprlang"
],
"hyprutils": [
"hyprland",
"hyprutils"
],
"hyprwayland-scanner": [
"hyprland",
"hyprwayland-scanner"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1755354946,
"narHash": "sha256-zdov5f/GcoLQc9qYIS1dUTqtJMeDqmBmo59PAxze6e4=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "a10726d6a8d0ef1a0c645378f983b6278c42eaa0",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1755864794,

View File

@ -7,6 +7,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
hyprshell.url = "git+https://gitgud.foo/thegrind/hypr-shell.git";
hyprland.url = "github:hyprwm/Hyprland";
# hyprland-plugins = {
# url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland";
# };
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";

View File

@ -142,7 +142,6 @@
programs = {
hyprland.enable = true;
ssh = {
startAgent = true;
extraConfig = "
@ -168,7 +167,7 @@
# Theme
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark.yaml";
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
# image = "/home/javi/Documents/wallpapers/Fantasy-Mountain.png";
polarity = "dark";
};

View File

@ -46,7 +46,7 @@
ms-python.python
ms-python.vscode-pylance
# Zig
ziglang.vscode-zig
# ziglang.vscode-zig
# C++
ms-vscode.cpptools
ms-vscode.cmake-tools
@ -87,6 +87,12 @@
version = "1.37.0";
sha256 = "q5CTRj746404yM9mhOWYAGTzt/8CJ7Fx4QUQSJ+LdLs=";
}
{
name = "vscode-antlers";
publisher = "stillat-llc";
version = "2.6.22";
sha256 = "3JtT5AxtbxciivfG6JaUYNPL74+8ydhDeB7SCE/92ko=";
}
# Qt Extension Pack
{
name = "qt-qml";
@ -115,7 +121,7 @@
"github.copilot.enable" = false;
"window.titleBarStyle" = "custom";
"window.customTitleBarVisibility" = "auto";
"workbench.colorTheme" = lib.mkForce "Gruvbox Dark Hard";
"workbench.colorTheme" = lib.mkForce "Stylix";
"git.autofetch" = true;
"editor.fontSize" = lib.mkForce 18;
"editor.snippetSuggestions" = "top";
@ -219,6 +225,10 @@
"workbench.editor.pinnedTabsOnSeparateRow" = true;
"C_Cpp.default.compileCommands" = "\${workspaceFolder}/build/compile_commands.json";
"C_Cpp.default.configurationProvider" = "ms-vscode.cmake-tools";
"antlersLanguageServer.languageVersion" = "runtime";
"[antlers]" = {
"editor.defaultFormatter" = "html";
};
"window.menuBarVisibility" = "compact";
"vim.leader" = "<space>";
"vim.normalModeKeyBindings" = [

View File

@ -23,6 +23,7 @@
];
bind = [
# "$mod, a, hyprexpo:expo, toggle"
# Start programs
"$mod, q, exec, $terminal"
"$mod SHIFT, o, exec, $browser"
@ -52,7 +53,8 @@
"$mod, f, fullscreen, 0"
"$mod, v, togglefloating, active"
"$mod, SPACE, exec, wofi --show drun"
# "$mod, SPACE, exec, wofi --show drun"
"$mod, SPACE, exec, waycast"
"$mod, d, exec, ${pkgs.wofi-emoji}/bin/wofi-emoji"
"$mod SHIFT, s, exec, flameshot gui"
@ -82,9 +84,4 @@
)
);
};
wayland.windowManager.hyprland.plugins = [
# inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars
];
}

View File

@ -19,6 +19,13 @@
home = {
sessionVariables = {
NIXOS_OZON_WL = "1";
HYPR_PLUGIN_DIR = pkgs.symlinkJoin {
name = "hyprland-plugins";
paths = with pkgs.hyprlandPlugins; [
hyprexpo
];
};
};
packages = with pkgs; [
@ -54,6 +61,10 @@
enable = true;
plugins = with pkgs.hyprlandPlugins; [
hyprexpo
];
settings = {
input = {
@ -103,9 +114,5 @@
"systemctl --user start hyprpolkitagent"
];
};
plugins = [
# inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars
];
};
}

View File

@ -1,5 +1,41 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
config,
lib,
...
}:
let
themeDirectory = "${config.programs.hyprpanel.package}/share/themes";
currentTheme = "monochrome";
raw = lib.importJSON "${themeDirectory}/${currentTheme}.json";
selectedTheme = if raw ? theme then raw.theme else raw;
# We need to turn the theme json into a nested attribute set. Otherwise we
# end up with an incorrect configuration that looks like:
# theme: {theme.bar.transparent: "value", theme.foo.bar: "another value"}
# when what we really want is: theme: {bar: ..., buttons: ...}
# ----
# turn "foo.bar.baz" and value into { foo = { bar = { baz = value; }; }; }
nestAttr = path: value: lib.attrsets.setAttrByPath (lib.splitString "." path) value;
# merge a flat attrset into nested
unflatten =
flat:
lib.foldlAttrs (
acc: k: v:
lib.recursiveUpdate acc (nestAttr k v)
) { } flat;
themeAttrs = unflatten selectedTheme;
base = themeAttrs.theme;
themeOverrides = {
font.size = "14px";
};
finalTheme = lib.recursiveUpdate base themeOverrides;
in
{
programs.hyprpanel = {
enable = true;
@ -41,17 +77,8 @@
menus.dashboard.directories.enabled = false;
menus.dashboard.stats.enable_gpu = true;
theme = import ./hyprpanel/theme-gruvbox.nix;
# theme.bar.transparent = {
# transparent = false;
# buttons.style = "wave";
# };
# theme.font = {
# name = "CaskaydiaCove NF";
# size = "14px";
# };
# theme = builtins.fromJSON (builtins.readFile "${themeDirectory}/${currentTheme}.json");
theme = finalTheme;
};
};
}

View File

@ -11,7 +11,7 @@
pkgs.hyprpaper
];
# Home Manager
xdg.configFile."wallpaper.png".source = "${assets}/wallpaper.png";
xdg.configFile."wallpaper.png".source = "${assets}/Fantasy-Landscape3.png";
services.hyprpaper = {
enable = true;
settings = {