refactor(waybar): store rendered window icons
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
|
||||
registry.window-icon.${config.networking.hostName}.obsidian = {
|
||||
class = "obsidian";
|
||||
icon = "f02d";
|
||||
icon = builtins.fromJSON ''"\uf02d"'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ in
|
||||
|
||||
registry.window-icon.${config.networking.hostName}.signal = {
|
||||
class = "[Ss]ignal";
|
||||
icon = "f4ad";
|
||||
icon = builtins.fromJSON ''"\uf4ad"'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
registry.window-icon.${config.networking.hostName}.steam = {
|
||||
class = "[Ss]team";
|
||||
icon = "f1b6";
|
||||
icon = builtins.fromJSON ''"\uf1b6"'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
|
||||
registry.window-icon.${config.networking.hostName}.vesktop = {
|
||||
class = "[Vv]esktop";
|
||||
icon = "f1ff";
|
||||
icon = builtins.fromJSON ''"\uf1ff"'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user