waybar: Add MPRIS module

This commit is contained in:
Erwin Boskma 2024-12-18 09:29:15 +01:00
parent 6636950cca
commit 1f0b100e86
Signed by: erwin
SSH key fingerprint: SHA256:3F6Cm6I3erRqlBwEghZWAQl6eS5WrGTX1Vs/Evec1lQ
2 changed files with 24 additions and 11 deletions

View file

@ -49,7 +49,8 @@ in
"sway/workspaces" "sway/workspaces"
"sway/mode" "sway/mode"
] ]
++ lib.optional (cfg.profile == "home") "custom/now_playing"; ++ lib.optional (cfg.profile == "home") "custom/now_playing"
++ lib.optional (cfg.profile == "work") "mpris";
modules-center = (lib.optional cfg.sway "sway/window") ++ (lib.optional cfg.river "river/window"); modules-center = (lib.optional cfg.sway "sway/window") ++ (lib.optional cfg.river "river/window");
@ -78,7 +79,7 @@ in
tooltip-format = "{:%e %B %Y}"; tooltip-format = "{:%e %B %Y}";
}; };
"cpu" = { cpu = {
interval = 5; interval = 5;
format = "󰻠 {usage}% ({load})"; # Icon: cpu_64_bit format = "󰻠 {usage}% ({load})"; # Icon: cpu_64_bit
states = { states = {
@ -87,7 +88,7 @@ in
}; };
}; };
"memory" = { memory = {
interval = 5; interval = 5;
format = "󰍛 {}%"; # Icon: memory format = "󰍛 {}%"; # Icon: memory
states = { states = {
@ -96,7 +97,7 @@ in
}; };
}; };
"network" = { network = {
interval = 5; interval = 5;
format-wifi = "󰖩 {essid} ({signalStrength}%)"; # Icon: wifi format-wifi = "󰖩 {essid} ({signalStrength}%)"; # Icon: wifi
format-ethernet = "󰈀 {ifname}: {ipaddr}/{cidr}"; # Icon: ethernet format-ethernet = "󰈀 {ifname}: {ipaddr}/{cidr}"; # Icon: ethernet
@ -116,6 +117,16 @@ in
on-scroll-up = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token-file /run/secrets/ha_now_playing_token volume-down"; on-scroll-up = "${pkgs.ha-now-playing}/bin/ha-now-playing --host home.datarift.nl --entity media_player.sonos_woonkamer --token-file /run/secrets/ha_now_playing_token volume-down";
}; };
mpris = {
format = "[{player}] {status_icon} {dynamic}";
status-icons = {
paused = "󰏤 "; # Icon: pause
playing = "󰐊 "; # Icon: play
stopped = "󰓛 "; # Icon: stop
};
on-click-middle = "stop";
};
"sway/mode" = { "sway/mode" = {
format = ''<span style="italic">󰁌 {}</span>''; # Icon: arrow_expand_all format = ''<span style="italic">󰁌 {}</span>''; # Icon: arrow_expand_all
tooltip = false; tooltip = false;
@ -132,9 +143,9 @@ in
format = "{icon} {name}"; format = "{icon} {name}";
sort-by-number = true; sort-by-number = true;
format-icons = { format-icons = {
"urgent" = ""; urgent = "";
"focused" = ""; focused = "";
"default" = ""; default = "";
}; };
}; };
@ -161,7 +172,7 @@ in
}; };
}; };
"wireplumber" = { wireplumber = {
format = "{icon} {volume}%"; format = "{icon} {volume}%";
format-muted = "󰖁"; # Icon: volume_off format-muted = "󰖁"; # Icon: volume_off
format-icons = { format-icons = {
@ -182,7 +193,7 @@ in
on-click-right = "${pkgs.easyeffects}/bin/easyeffects"; on-click-right = "${pkgs.easyeffects}/bin/easyeffects";
}; };
"temperature" = { temperature = {
hwmon-path = cfg.cpuTempPath; hwmon-path = cfg.cpuTempPath;
critical-threshold = 80; critical-threshold = 80;
interval = 5; interval = 5;
@ -197,11 +208,12 @@ in
tooltip = true; tooltip = true;
}; };
"tray" = { tray = {
icon-size = 21; icon-size = 21;
spacing = 10; spacing = 10;
}; };
"idle_inhibitor" = {
idle_inhibitor = {
format = ''<span size="large">{icon}</span>''; format = ''<span size="large">{icon}</span>'';
format-icons = { format-icons = {
activated = "󰛐"; activated = "󰛐";

View file

@ -283,6 +283,7 @@ in
"secrets" "secrets"
]; ];
}; };
playerctld.enable = true;
udiskie = { udiskie = {
enable = true; enable = true;
tray = "auto"; tray = "auto";