Compare commits
1 Commits
cf771102ea
...
f0c5544b10
| Author | SHA1 | Date | |
|---|---|---|---|
| f0c5544b10 |
@@ -26,6 +26,11 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
registry.window-icon.${config.networking.hostName}.firefox = {
|
||||||
|
class = ".*[Ff]irefox.*";
|
||||||
|
icon = "f269";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.users.${config.user.name} = hm: {
|
home-manager.users.${config.user.name} = hm: {
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -20,6 +20,11 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
registry.window-icon.${config.networking.hostName}.ghostty = {
|
||||||
|
class = "com.mitchellh.ghostty";
|
||||||
|
icon = "f120";
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.users.${user}.home.packages = [ pkgs.ghostty ];
|
home-manager.users.${user}.home.packages = [ pkgs.ghostty ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,5 +14,10 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.apps.obsidian.enable {
|
config = lib.mkIf config.modules.desktop.apps.obsidian.enable {
|
||||||
home-manager.users.${user}.home.packages = [ pkgs.obsidian ];
|
home-manager.users.${user}.home.packages = [ pkgs.obsidian ];
|
||||||
|
|
||||||
|
registry.window-icon.${config.networking.hostName}.obsidian = {
|
||||||
|
class = "obsidian";
|
||||||
|
icon = "f02d";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,10 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.apps.signal.enable {
|
config = lib.mkIf config.modules.desktop.apps.signal.enable {
|
||||||
home-manager.users.${user}.home.packages = [ pkgs.signal-desktop ];
|
home-manager.users.${user}.home.packages = [ pkgs.signal-desktop ];
|
||||||
|
|
||||||
|
registry.window-icon.${config.networking.hostName}.signal = {
|
||||||
|
class = "[Ss]ignal";
|
||||||
|
icon = "f4ad";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,5 +23,10 @@
|
|||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.gamescope
|
pkgs.gamescope
|
||||||
];
|
];
|
||||||
|
|
||||||
|
registry.window-icon.${config.networking.hostName}.steam = {
|
||||||
|
class = "[Ss]team";
|
||||||
|
icon = "f1b6";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,5 +14,10 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf config.modules.desktop.apps.vencord.enable {
|
config = lib.mkIf config.modules.desktop.apps.vencord.enable {
|
||||||
home-manager.users.${user}.home.packages = [ pkgs.vesktop ];
|
home-manager.users.${user}.home.packages = [ pkgs.vesktop ];
|
||||||
|
|
||||||
|
registry.window-icon.${config.networking.hostName}.vesktop = {
|
||||||
|
class = "[Vv]esktop";
|
||||||
|
icon = "f1ff";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ let
|
|||||||
# A Nerd Font Private-Use-Area codepoint as a literal character, decoded
|
# A Nerd Font Private-Use-Area codepoint as a literal character, decoded
|
||||||
# through JSON so the glyph survives as bytes rather than an editor paste.
|
# through JSON so the glyph survives as bytes rather than an editor paste.
|
||||||
g = code: builtins.fromJSON ''"\u${code}"'';
|
g = code: builtins.fromJSON ''"\u${code}"'';
|
||||||
user = config.user.name;
|
|
||||||
|
|
||||||
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
|
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ let
|
|||||||
# With no mako daemon answering, the status reads "notifications on", keeping
|
# With no mako daemon answering, the status reads "notifications on", keeping
|
||||||
# the widget inert rather than broken.
|
# the widget inert rather than broken.
|
||||||
dndStatus = pkgs.writeShellScript "waybar-dnd-status" ''
|
dndStatus = pkgs.writeShellScript "waybar-dnd-status" ''
|
||||||
if ${pkgs.mako}/bin/makoctl mode 2>/dev/null | ${pkgs.gnugrep}/bin/grep -qx dnd; then
|
if ${lib.getExe' pkgs.mako "makoctl"} mode 2>/dev/null | ${lib.getExe pkgs.gnugrep} -qx dnd; then
|
||||||
printf '{"text":"${g "f1f6"}","tooltip":"Do not disturb: on","class":"dnd"}\n'
|
printf '{"text":"${g "f1f6"}","tooltip":"Do not disturb: on","class":"dnd"}\n'
|
||||||
else
|
else
|
||||||
printf '{"text":"${g "f0f3"}","tooltip":"Notifications on","class":"active"}\n'
|
printf '{"text":"${g "f0f3"}","tooltip":"Notifications on","class":"active"}\n'
|
||||||
@@ -27,14 +26,14 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
dndToggle = pkgs.writeShellScript "waybar-dnd-toggle" ''
|
dndToggle = pkgs.writeShellScript "waybar-dnd-toggle" ''
|
||||||
${pkgs.mako}/bin/makoctl mode -t dnd >/dev/null 2>&1
|
${lib.getExe' pkgs.mako "makoctl"} mode -t dnd >/dev/null 2>&1
|
||||||
${pkgs.procps}/bin/pkill -RTMIN+8 waybar
|
${lib.getExe' pkgs.procps "pkill"} -RTMIN+8 waybar
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Lit while a wf-recorder capture is running.
|
# Lit while a wf-recorder capture is running.
|
||||||
# Empty text collapses the widget when idle, so it shows nothing until then.
|
# Empty text collapses the widget when idle, so it shows nothing until then.
|
||||||
recStatus = pkgs.writeShellScript "waybar-recording-status" ''
|
recStatus = pkgs.writeShellScript "waybar-recording-status" ''
|
||||||
if ${pkgs.procps}/bin/pgrep -x wf-recorder >/dev/null; then
|
if ${lib.getExe' pkgs.procps "pgrep"} -x wf-recorder >/dev/null; then
|
||||||
printf '{"text":"${g "f03d"}","tooltip":"Recording","class":"recording"}\n'
|
printf '{"text":"${g "f03d"}","tooltip":"Recording","class":"recording"}\n'
|
||||||
else
|
else
|
||||||
printf '{"text":"","class":"idle"}\n'
|
printf '{"text":"","class":"idle"}\n'
|
||||||
@@ -42,7 +41,7 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
idleLockStatus = pkgs.writeShellScript "waybar-idle-lock-status" ''
|
idleLockStatus = pkgs.writeShellScript "waybar-idle-lock-status" ''
|
||||||
if ${pkgs.systemd}/bin/systemctl --user is-active --quiet lockscreen-idle-inhibit.service; then
|
if ${lib.getExe' pkgs.systemd "systemctl"} --user is-active --quiet lockscreen-idle-inhibit.service; then
|
||||||
printf '{"text":"${sleepOffIcon}","tooltip":"Idle locking inhibited","class":"inhibited"}\n'
|
printf '{"text":"${sleepOffIcon}","tooltip":"Idle locking inhibited","class":"inhibited"}\n'
|
||||||
else
|
else
|
||||||
printf '{"text":"","class":"idle"}\n'
|
printf '{"text":"","class":"idle"}\n'
|
||||||
@@ -52,14 +51,14 @@ let
|
|||||||
vpnStatus = pkgs.writeShellScript "waybar-vpn-status" ''
|
vpnStatus = pkgs.writeShellScript "waybar-vpn-status" ''
|
||||||
interface=${lib.escapeShellArg vpnClient.interface}
|
interface=${lib.escapeShellArg vpnClient.interface}
|
||||||
|
|
||||||
if ! ${pkgs.iproute2}/bin/ip link show dev "$interface" >/dev/null 2>&1; then
|
if ! ${lib.getExe' pkgs.iproute2 "ip"} link show dev "$interface" >/dev/null 2>&1; then
|
||||||
printf '{"text":"","class":"idle"}\n'
|
printf '{"text":"","class":"idle"}\n'
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ipaddr=$(${pkgs.iproute2}/bin/ip -4 -o addr show dev "$interface" | ${pkgs.gawk}/bin/awk '{ print $4; exit }')
|
ipaddr=$(${lib.getExe' pkgs.iproute2 "ip"} -4 -o addr show dev "$interface" | ${lib.getExe' pkgs.gawk "awk"} '{ print $4; exit }')
|
||||||
|
|
||||||
${pkgs.jq}/bin/jq -cn \
|
${lib.getExe pkgs.jq} -cn \
|
||||||
--arg text "" \
|
--arg text "" \
|
||||||
--arg tooltip "VPN $interface: ''${ipaddr:-no IPv4}" \
|
--arg tooltip "VPN $interface: ''${ipaddr:-no IPv4}" \
|
||||||
--arg class "active" \
|
--arg class "active" \
|
||||||
@@ -68,12 +67,12 @@ let
|
|||||||
|
|
||||||
networkStatus = pkgs.writeShellScript "waybar-network-status" ''
|
networkStatus = pkgs.writeShellScript "waybar-network-status" ''
|
||||||
active=$(
|
active=$(
|
||||||
${pkgs.networkmanager}/bin/nmcli -t -f DEVICE,TYPE,STATE,CONNECTION device status \
|
${lib.getExe' pkgs.networkmanager "nmcli"} -t -f DEVICE,TYPE,STATE,CONNECTION device status \
|
||||||
| ${pkgs.gawk}/bin/awk -F: '$3 == "connected" && $2 != "loopback" { print; exit }'
|
| ${lib.getExe' pkgs.gawk "awk"} -F: '$3 == "connected" && $2 != "loopback" { print; exit }'
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ -z "$active" ]; then
|
if [ -z "$active" ]; then
|
||||||
${pkgs.jq}/bin/jq -cn \
|
${lib.getExe pkgs.jq} -cn \
|
||||||
--arg text "${g "f127"} off" \
|
--arg text "${g "f127"} off" \
|
||||||
--arg tooltip "Network disconnected" \
|
--arg tooltip "Network disconnected" \
|
||||||
--arg class "disconnected" \
|
--arg class "disconnected" \
|
||||||
@@ -89,9 +88,9 @@ let
|
|||||||
*) icon="NET" ;;
|
*) icon="NET" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
ipaddr=$(${pkgs.iproute2}/bin/ip -4 -o addr show dev "$device" | ${pkgs.gawk}/bin/awk '{ print $4; exit }')
|
ipaddr=$(${lib.getExe' pkgs.iproute2 "ip"} -4 -o addr show dev "$device" | ${lib.getExe' pkgs.gawk "awk"} '{ print $4; exit }')
|
||||||
|
|
||||||
${pkgs.jq}/bin/jq -cn \
|
${lib.getExe pkgs.jq} -cn \
|
||||||
--arg text "$icon $connection" \
|
--arg text "$icon $connection" \
|
||||||
--arg tooltip "$device: ''${ipaddr:-no IPv4}" \
|
--arg tooltip "$device: ''${ipaddr:-no IPv4}" \
|
||||||
--arg class "$type" \
|
--arg class "$type" \
|
||||||
@@ -106,7 +105,7 @@ in
|
|||||||
# codepoints Stylix's monospace font does not carry.
|
# codepoints Stylix's monospace font does not carry.
|
||||||
fonts.packages = [ pkgs.nerd-fonts.symbols-only ];
|
fonts.packages = [ pkgs.nerd-fonts.symbols-only ];
|
||||||
|
|
||||||
home-manager.users.${user}.programs.waybar = {
|
home-manager.users.${config.user.name}.programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# A user service bound to graphical-session.target, which uwsm activates,
|
# A user service bound to graphical-session.target, which uwsm activates,
|
||||||
@@ -151,16 +150,9 @@ in
|
|||||||
format = "{id} {windows}";
|
format = "{id} {windows}";
|
||||||
format-window-separator = " ";
|
format-window-separator = " ";
|
||||||
window-rewrite-default = g "f2d0";
|
window-rewrite-default = g "f2d0";
|
||||||
window-rewrite = {
|
window-rewrite = lib.mapAttrs' (
|
||||||
"class<com.mitchellh.ghostty>" = g "f120";
|
_name: windowIcon: lib.nameValuePair "class<${windowIcon.class}>" (g windowIcon.icon)
|
||||||
"class<.*[Ff]irefox.*>" = g "f269";
|
) (lib.attrByPath [ config.networking.hostName ] { } config.registry.window-icon);
|
||||||
"class<chromium.*>" = g "f268";
|
|
||||||
"class<[Cc]ode>" = g "f121";
|
|
||||||
"class<obsidian>" = g "f02d";
|
|
||||||
"class<[Ss]ignal>" = g "f4ad";
|
|
||||||
"class<[Ss]team>" = g "f1b6";
|
|
||||||
"class<[Vv]esktop>" = g "f1ff";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
clock = {
|
clock = {
|
||||||
@@ -190,7 +182,7 @@ in
|
|||||||
(g "f027")
|
(g "f027")
|
||||||
(g "f028")
|
(g "f028")
|
||||||
];
|
];
|
||||||
on-click = "${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
on-click = "${lib.getExe' pkgs.wireplumber "wpctl"} set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||||
};
|
};
|
||||||
|
|
||||||
"custom/vpn" = {
|
"custom/vpn" = {
|
||||||
|
|||||||
19
configs/nixos/registry/window-icon.nix
Normal file
19
configs/nixos/registry/window-icon.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
type = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
class = lib.mkOption {
|
||||||
|
description = "Matches the window class reported by the compositor.";
|
||||||
|
type = lib.types.str;
|
||||||
|
example = ".*[Ff]irefox.*";
|
||||||
|
};
|
||||||
|
|
||||||
|
icon = lib.mkOption {
|
||||||
|
description = "Sets the Nerd Font codepoint shown for matching windows.";
|
||||||
|
type = lib.types.str;
|
||||||
|
example = "f269";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user