yep, more dotfiles

waybar: have a different waybar between outputs

Mysteriously fixes waybar crashes. Maybe because outputs don't use the
same bar anymore.

wiro.world 00e3d469 f5c1141c

verified
Changed files
+142 -111
home-manager
fragments
+142 -111
home-manager/fragments/waybar.nix
···
programs.waybar = {
enable = true;
-
settings.main = {
-
mode = "hide";
-
ipc = true;
-
position = "bottom";
-
output = [ "eDP-1" ];
+
settings =
+
let
+
modules-settings = {
+
"sway/workspaces" = {
+
disable-scroll = true;
+
format = "{name} {icon}";
+
format-icons = {
+
default = " ";
-
modules-left = [
-
"sway/workspaces"
-
];
+
"1" = " ";
+
"2" = " ";
+
"3" = " ";
+
"4" = " ";
+
"9" = " ";
+
"10" = " ";
+
};
+
};
-
"sway/workspaces" = {
-
disable-scroll = true;
-
format = "{name} {icon}";
-
format-icons = {
-
default = " ";
+
"group/misc" = {
+
orientation = "inherit";
+
modules = [
+
"custom/notifications"
+
"tray"
+
"idle_inhibitor"
+
];
-
"1" = " ";
-
"2" = " ";
-
"3" = " ";
-
"4" = " ";
-
"9" = " ";
-
"10" = " ";
-
};
-
};
+
drawer = {
+
transition-duration = 250;
+
transition-left-to-right = false;
+
};
+
};
+
+
"custom/notifications" = {
+
format = "{icon}";
+
format-icons = {
+
normal = " ";
+
dnd = " ";
+
};
+
tooltip = false;
+
+
interval = "once";
+
return-type = "json";
+
exec = ''${makoctl} mode | rg dnd >/dev/null; if [ $? == 0 ]; then echo '{"alt":"dnd"}'; else echo '{"alt":"normal"}'; fi'';
+
on-click = "${makoctl} mode -t dnd; pkill -SIGRTMIN+10 waybar";
+
signal = 10;
+
# rely on on click pkill signal
+
exec-on-event = false;
+
};
+
+
idle_inhibitor = {
+
format = "{icon}";
+
format-icons = {
+
activated = " ";
+
deactivated = " ";
+
};
+
};
-
modules-center = [ ];
+
tray.spacing = 10;
-
modules-right = [
-
"cava"
-
"mpris"
-
"pulseaudio"
-
"battery"
-
"clock"
-
"group/misc"
-
];
+
clock = {
+
format = "{:%d %b %H:%M}";
+
tooltip = false;
+
};
-
"group/misc" = {
-
orientation = "inherit";
-
modules = [
-
"custom/notifications"
-
"tray"
-
"idle_inhibitor"
-
];
+
battery = {
+
states = {
+
good = 95;
+
warning = 30;
+
critical = 15;
+
};
-
drawer = {
-
transition-duration = 250;
-
transition-left-to-right = false;
-
};
-
};
+
format = "{capacity}% {icon}";
+
format-full = "{capacity}% {icon}";
+
format-charging = "{capacity}% ";
+
format-plugged = "{capacity}% ";
+
format-icons = [ " " " " " " " " " " ];
+
};
-
"custom/notifications" = {
-
format = "{icon}";
-
format-icons = {
-
normal = " ";
-
dnd = " ";
-
};
-
tooltip = false;
+
pulseaudio = {
+
scroll-step = 5;
+
tooltip = false;
-
interval = "once";
-
return-type = "json";
-
exec = ''${makoctl} mode | rg dnd >/dev/null; if [ $? == 0 ]; then echo '{"alt":"dnd"}'; else echo '{"alt":"normal"}'; fi'';
-
on-click = "${makoctl} mode -t dnd; pkill -SIGRTMIN+10 waybar";
-
signal = 10;
-
# rely on on click pkill signal
-
exec-on-event = false;
-
};
+
format = "{volume}% {icon}{format_source}";
+
format-bluetooth = "{volume}% {icon}{format_source}";
+
format-bluetooth-muted = " {icon} {format_source}";
+
format-muted = " {format_source}";
+
format-source = "";
+
format-source-muted = "  ";
-
idle_inhibitor = {
-
format = "{icon}";
-
format-icons = {
-
activated = " ";
-
deactivated = " ";
-
};
-
};
+
format-icons = {
+
headset = " ";
+
headphone = " ";
+
hands-free = " ";
+
phone = " ";
+
portable = " ";
+
car = " ";
+
default = [ "" " " " " ];
+
};
-
tray.spacing = 10;
+
on-click = "pavucontrol";
+
};
-
clock = {
-
format = "{:%d %b %H:%M}";
-
tooltip = false;
-
};
+
mpris = {
+
format = "{title:.30} - {artist:.30}";
+
tooltip-format = "{album} ({player})";
+
};
-
battery = {
-
states = {
-
good = 95;
-
warning = 30;
-
critical = 15;
+
cava = {
+
bars = 6;
+
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
+
bar_delimiter = 0;
+
hide_on_silence = true;
+
};
};
-
format = "{capacity}% {icon}";
-
format-full = "{capacity}% {icon}";
-
format-charging = "{capacity}% ";
-
format-plugged = "{capacity}% ";
-
format-icons = [ " " " " " " " " " " ];
-
};
+
in
+
{
+
primary = {
+
mode = "hide";
+
ipc = true;
+
position = "bottom";
+
output = [ "eDP-1" ];
-
pulseaudio = {
-
scroll-step = 5;
-
tooltip = false;
+
modules-left = [
+
"sway/workspaces"
+
];
-
format = "{volume}% {icon}{format_source}";
-
format-bluetooth = "{volume}% {icon}{format_source}";
-
format-bluetooth-muted = " {icon} {format_source}";
-
format-muted = " {format_source}";
-
format-source = "";
-
format-source-muted = "  ";
+
modules-center = [ ];
-
format-icons = {
-
headset = " ";
-
headphone = " ";
-
hands-free = " ";
-
phone = " ";
-
portable = " ";
-
car = " ";
-
default = [ "" " " " " ];
-
};
+
modules-right = [
+
"cava"
+
"mpris"
+
"pulseaudio"
+
"battery"
+
"clock"
+
"group/misc"
+
];
+
} // modules-settings;
-
on-click = "pavucontrol";
-
};
+
additional = {
+
mode = "hide";
+
ipc = true;
+
position = "bottom";
+
output = [
+
"DP-1"
+
"DP-2"
+
"DP-3"
+
"DP-4"
+
"HDMI-1"
+
"HDMI-2"
+
"HDMI-3"
+
"HDMI-4"
+
];
-
mpris = {
-
format = "{title:.30} - {artist:.30}";
-
tooltip-format = "{album} ({player})";
-
};
+
modules-left = [
+
"sway/workspaces"
+
];
-
cava = {
-
bars = 6;
-
format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ];
-
bar_delimiter = 0;
-
hide_on_silence = true;
+
modules-right = [
+
"clock"
+
"group/misc"
+
];
+
} // modules-settings;
};
-
};
style = ''
#waybar { color: @base00; }
···
}];
};
}
-