Waybar : Add groups.

This commit is contained in:
Dmitry Voronin 2024-09-13 23:05:51 +03:00
parent dc5010e303
commit b9eaa1467d
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 40 additions and 56 deletions

View file

@ -3,8 +3,7 @@
in {
file = (pkgs.formats.json {}).generate "WaybarConfig" {
height = 34;
layer = "top";
margin-left = config.style.window.gap;
layer = "top"; margin-left = config.style.window.gap;
margin-right = config.style.window.gap;
margin-top = config.style.window.gap;
mode = "dock";
@ -28,12 +27,8 @@ in {
modules-right = [
"sway/language"
"pulseaudio"
"battery"
"custom/powerlimit"
"cpu"
"temperature"
"memory"
"custom/powersave"
"group/batteryinfo"
"group/hardware"
"custom/display"
"tray"
];
@ -78,6 +73,15 @@ in {
on-click-right = "powerlimit toggle";
interval = refreshInterval;
};
"custom/powerlimit" = {
exec = "powerlimit widget";
on-click-right = "powerlimit toggle";
signal = 6;
};
"group/batteryinfo" = {
orientation = "horizontal";
modules = [ "battery" "custom/powerlimit" ];
};
pulseaudio = {
scroll-step = 5;
format = "{volume}%{icon}{format_source}";
@ -128,6 +132,16 @@ in {
on-click-right = "powersave toggle";
tooltip = false;
};
"custom/powersave" = {
exec = "powersave widget";
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";
signal = 5;
};
"group/hardware" = {
orientation = "horizontal";
modules = [ "cpu" "memory" "temperature" "custom/powersave" ];
};
"custom/display" = {
exec = "swayscript displaywidget";
on-click = "sleep 0.1 && swayscript dnd"; # HACK: https://github.com/Alexays/Waybar/issues/2166 & https://github.com/Alexays/Waybar/issues/1968
@ -136,16 +150,5 @@ in {
return-type = "json";
signal = 4;
};
"custom/powersave" = {
exec = "powersave widget";
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";
signal = 5;
};
"custom/powerlimit" = {
exec = "powerlimit widget";
on-click-right = "powerlimit toggle";
signal = 6;
};
};
}

View file

@ -2,61 +2,42 @@
paddingV = "0";
paddingH = "12px";
in {
# ISSUE: https://github.com/Alexays/Waybar/issues/3303
text = ''
#pulseaudio,
#mpris,
#battery,
#custom-display,
#custom-powersave,
#custom-powerlimit,
#tray,
#temperature,
#memory,
#cpu,
#batteryinfo,
#clock,
#custom-display,
#hardware,
#language,
#mpris,
#pulseaudio,
#scratchpad,
#language {
#tray {
padding: ${paddingV} ${paddingH};
border-top: ${toString config.style.window.border}px solid transparent;
border-bottom: ${toString config.style.window.border}px solid transparent;
}
#cpu {
padding-right: 0;
}
#temperature {
padding-left: 0;
padding-right: 0;
}
#memory {
padding-left: 0;
}
#custom-powersave,
#custom-powerlimit {
margin-left: -${paddingH};
padding-left: 0;
}
#clock {
font-weight: bold;
}
#battery:hover,
#custom-powerlimit,
#custom-powersave,
#memory,
#temperature {
padding-left: 4px;
}
#batteryinfo:hover,
#clock:hover,
#cpu:hover,
#custom-display:hover,
#custom-powerlimit:hover,
#custom-powersave:hover,
#hardware:hover,
#language:hover,
#memory:hover,
#mpris:hover,
#pulseaudio:hover,
#temperature:hover,
#tray:hover,
#scratchpad:hover,
#tray:hover,
#workspaces button:hover {
background-color: rgba(${config.style.color.border-r},${config.style.color.border-g},${config.style.color.border-b},${toString config.style.opacity.desktop});
}