waybar: Migrate icons to Nerd Fonts 3

This commit is contained in:
Simon Bruder 2023-05-30 14:03:12 +02:00
parent 704f1e8d7f
commit 7c936fa4cc
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -16,10 +16,6 @@ let
fi fi
''; '';
# nerd fonts are abusing arabic which breaks latin text
# context: https://github.com/Alexays/Waybar/issues/628
lrm = "‎";
# for fine-grained control over spacing # for fine-grained control over spacing
thinsp = " "; thinsp = " ";
in in
@ -71,14 +67,14 @@ in
{ class = "inactive"; }; { class = "inactive"; };
on-click = toggleUserUnitState "gammastep"; on-click = toggleUserUnitState "gammastep";
return-type = "json"; return-type = "json";
format = ""; format = "󰌵";
tooltip = false; tooltip = false;
}; };
idle_inhibitor = { idle_inhibitor = {
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
activated = " "; activated = "󰈈 ";
deactivated = " "; deactivated = "󰈉 ";
}; };
}; };
"custom/screencast" = { "custom/screencast" = {
@ -104,7 +100,7 @@ in
print(f"Invalid action {action} (in line {line})", file=sys.stderr) print(f"Invalid action {action} (in line {line})", file=sys.stderr)
if active_outputs > 0: if active_outputs > 0:
print("${lrm} ") print("󰄘 ")
else: else:
print() print()
@ -115,15 +111,15 @@ in
}; };
backlight = { backlight = {
format = "{percent}% {icon}"; format = "{percent}% {icon}";
format-icons = [ " " " " " " " " " " " " " " ]; format-icons = [ "󰃚 " "󰃛 " "󰃜 " "󰃝 " "󰃞 " "󰃟 " "󰃠 " ];
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl -q set +5%"; on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl -q set +5%";
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-"; on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl -q set 5%-";
}; };
mpd = { mpd = {
server = config.services.mpd.network.listenAddress; server = config.services.mpd.network.listenAddress;
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) "; format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) 󰎈";
format-disconnected = "Disconnected "; format-disconnected = "Disconnected 󰎊";
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped "; format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped 󰓛";
unknown-tag = "N/A"; unknown-tag = "N/A";
interval = 2; interval = 2;
tooltip-format = "MPD (connected)"; tooltip-format = "MPD (connected)";
@ -136,47 +132,47 @@ in
title-len = 48; title-len = 48;
artist-len = 24; artist-len = 24;
consume-icons = { consume-icons = {
on = " "; on = "󰆐 ";
}; };
random-icons = { random-icons = {
off = " "; off = "󰒞 ";
on = " "; on = "󰒝 ";
}; };
repeat-icons = { repeat-icons = {
on = " "; on = "󰑖 ";
}; };
single-icons = { single-icons = {
on = " "; on = "󰑘 ";
}; };
state-icons = { state-icons = {
paused = ""; paused = "󰏤";
playing = ""; playing = "󰐊";
}; };
}; };
pulseaudio = { pulseaudio = {
format = "{volume}% {icon} {format_source}"; format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}"; format-bluetooth = "{volume}% {icon}󰂯 {format_source}";
format-bluetooth-muted = "${lrm}${lrm} {icon} {format_source}"; format-bluetooth-muted = "󰝟 {icon}󰂯 {format_source}";
format-muted = "${lrm}${lrm} {format_source}"; format-muted = "󰝟 {format_source}";
format-source = "{volume}% ${thinsp}"; format-source = "{volume}% 󰍬${thinsp}";
format-source-muted = "${thinsp}"; format-source-muted = "󰍭${thinsp}";
format-icons = { format-icons = {
car = " "; car = "󰄋 ";
default = [ "" "奔" "" ]; default = [ "󰕿" "󰖀" "󰕾" ];
hands-free = " "; hands-free = "󰋎 ";
headphone = " "; headphone = "󰋋 ";
headset = " "; headset = "󰋎 ";
phone = " "; phone = "󰏲 ";
portable = " "; portable = "󰏲 ";
}; };
on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
on-click-right = "${pkgs.unstable.helvum}/bin/helvum"; on-click-right = "${pkgs.unstable.helvum}/bin/helvum";
}; };
network = { network = {
format-wifi = "{essid} ({signalStrength}%) "; format-wifi = "{essid} ({signalStrength}%) 󰖩 ";
format-ethernet = "{ipaddr}/{cidr} "; format-ethernet = "{ipaddr}/{cidr} 󰈀 ";
format-linked = "{ifname} (No IP) "; format-linked = "{ifname} (No IP) 󰈀 ";
format-disconnected = "Disconnected "; format-disconnected = "Disconnected 󰌙 ";
format-alt = "{ifname}: {ipaddr}/{cidr}"; format-alt = "{ifname}: {ipaddr}/{cidr}";
tooltip = false; tooltip = false;
on-click-right = "foot -e ${pkgs.networkmanager}/bin/nmtui"; on-click-right = "foot -e ${pkgs.networkmanager}/bin/nmtui";
@ -186,7 +182,7 @@ in
exec = pkgs.writeShellScript "vpn-state" '' exec = pkgs.writeShellScript "vpn-state" ''
${pkgs.iproute}/bin/ip -j link \ ${pkgs.iproute}/bin/ip -j link \
| ${pkgs.jq}/bin/jq --unbuffered --compact-output ' | ${pkgs.jq}/bin/jq --unbuffered --compact-output '
[[.[].ifname | select(. | startswith("mlv"))][] | sub("mlv-"; "") + " ${thinsp}"] as $conns [[.[].ifname | select(. | startswith("mlv"))][] | sub("mlv-"; "") + " 󰌾${thinsp}"] as $conns
| { text: ($conns[0] // ""), class: (if $conns | length > 0 then "connected" else "disconnected" end) }' | { text: ($conns[0] // ""), class: (if $conns | length > 0 then "connected" else "disconnected" end) }'
''; '';
return-type = "json"; return-type = "json";
@ -195,11 +191,11 @@ in
}; };
memory = { memory = {
interval = 2; interval = 2;
format = "{:2}% "; format = "{:2}% 󰍛 ";
}; };
cpu = { cpu = {
interval = 2; interval = 2;
format = "{usage:2}% "; format = "{usage:2}% 󰘚 ";
tooltip = false; tooltip = false;
}; };
temperature = { temperature = {
@ -210,10 +206,10 @@ in
battery = { battery = {
interval = 5; interval = 5;
format = "{capacity}% {icon}"; format = "{capacity}% {icon}";
format-charging = "{capacity}% "; format-charging = "{capacity}% 󰂄";
format-plugged = "{capacity}% ${lrm}"; format-plugged = "{capacity}% 󰚥";
format-alt = "{time} {icon}"; format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ]; format-icons = [ "󱃍" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
states = { states = {
critical = 15; critical = 15;
good = 95; good = 95;
@ -261,9 +257,9 @@ in
events_today = [] events_today = []
if len(events_today) == 0: if len(events_today) == 0:
text = " " text = "󰃮 "
else: else:
text = f"{len(events_today)} " text = f"{len(events_today)} 󰃭 "
print( print(
json.dumps( json.dumps(
@ -282,10 +278,10 @@ in
tooltip = false; tooltip = false;
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
notification = "${thinsp}"; notification = "󱅫${thinsp}";
none = "${thinsp}"; none = "󰂚${thinsp}";
dnd-notification = "${thinsp}"; dnd-notification = "󰂛${thinsp}";
dnd-none = "${thinsp}"; dnd-none = "󰂛${thinsp}";
}; };
return-type = "json"; return-type = "json";
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb"; exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";