refactor(waybar): store rendered window icons

This commit is contained in:
2026-10-11 20:08:20 -04:00
parent 5ba231d590
commit 5b644e1fd2
9 changed files with 12 additions and 15 deletions

View File

@@ -28,7 +28,7 @@ in
config = lib.mkIf cfg.enable {
registry.window-icon.${config.networking.hostName}.firefox = {
class = ".*[Ff]irefox.*";
icon = "f269";
icon = builtins.fromJSON ''"\uf269"'';
};
home-manager.users.${config.user.name} = hm: {

View File

@@ -22,7 +22,7 @@ in
registry.window-icon.${config.networking.hostName}.ghostty = {
class = "com.mitchellh.ghostty";
icon = "f120";
icon = builtins.fromJSON ''"\uf120"'';
};
home-manager.users.${user}.home.packages = [ pkgs.ghostty ];

View File

@@ -17,7 +17,7 @@ in
registry.window-icon.${config.networking.hostName}.obsidian = {
class = "obsidian";
icon = "f02d";
icon = builtins.fromJSON ''"\uf02d"'';
};
};
}

View File

@@ -16,7 +16,7 @@ in
registry.window-icon.${config.networking.hostName}.signal = {
class = "[Ss]ignal";
icon = "f4ad";
icon = builtins.fromJSON ''"\uf4ad"'';
};
};
}

View File

@@ -26,7 +26,7 @@
registry.window-icon.${config.networking.hostName}.steam = {
class = "[Ss]team";
icon = "f1b6";
icon = builtins.fromJSON ''"\uf1b6"'';
};
};
}

View File

@@ -17,7 +17,7 @@ in
registry.window-icon.${config.networking.hostName}.vesktop = {
class = "[Vv]esktop";
icon = "f1ff";
icon = builtins.fromJSON ''"\uf1ff"'';
};
};
}

View File

@@ -4,9 +4,6 @@
...
}:
# The Hyprland compositor.
let
glyph = code: builtins.fromJSON ''"\u${code}"'';
in
{
options.modules.desktop.session.hyprland.enable = lib.mkEnableOption "the Hyprland compositor";
@@ -238,9 +235,9 @@ in
on-click = "activate";
format = "{id} {windows}";
format-window-separator = " ";
window-rewrite-default = glyph "f2d0";
window-rewrite-default = builtins.fromJSON ''"\uf2d0"'';
window-rewrite = lib.mapAttrs' (
_name: windowIcon: lib.nameValuePair "class<${windowIcon.class}>" (glyph windowIcon.icon)
_name: windowIcon: lib.nameValuePair "class<${windowIcon.class}>" windowIcon.icon
) (lib.attrByPath [ config.networking.hostName ] { } config.registry.window-icon);
};
};