another day another tweaking of waybar

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-07-28 17:16:42 +03:00
parent ec6211cc54
commit 099ac245aa

View File

@@ -6,8 +6,6 @@
launcher, launcher,
... ...
}: let }: let
inherit (config.lib.stylix) colors;
ifLaptop = lib.mkIf (osConfig.networking.hostName != "dunamis"); ifLaptop = lib.mkIf (osConfig.networking.hostName != "dunamis");
in { in {
enable = true; enable = true;
@@ -19,15 +17,15 @@ in {
position = "bottom"; position = "bottom";
height = 33; height = 33;
spacing = 0; spacing = 0;
# margin-left = 36 + 3; margin-left = 36 + 3;
# margin-right = 36 + 3; margin-right = 36 + 3;
# margin-bottom = 3; margin-bottom = 3;
modules-left = [ modules-left = [
"custom/launcher" "custom/launcher"
"wlr/taskbar" "wlr/taskbar"
# "privacy"
]; ];
modules-right = [ modules-right = [
"clock"
"niri/workspaces" "niri/workspaces"
"niri/language" "niri/language"
]; ];
@@ -39,133 +37,17 @@ in {
format-en = "🇺🇸"; format-en = "🇺🇸";
format-uk = "🇺🇦"; format-uk = "🇺🇦";
}; };
"group/laptop" = {
orientation = "inherit";
modules = [
"backlight"
"battery"
"power-profiles-daemon"
];
};
backlight = {
format = "{percent}% {icon}";
format-icons = [
"󰃚"
"󰃛"
"󰃜"
"󰃝"
"󰃞"
"󰃟"
"󰃠"
];
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "󰅶";
deactivated = "󰾪";
};
};
tray = {
icon-size = 16;
spacing = 6;
};
clock = { clock = {
interval = 1;
format = "{:%R}"; format = "{:%R}";
interval = 1;
tooltip = true; tooltip = true;
tooltip-format = "{:%B %d, %A}"; tooltip-format = "{:%B %d, %A}";
}; };
battery = {
states = {
good = 95;
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-full = "{capacity}% 󱟢";
format-charging = "{capacity}% 󰂄";
format-plugged = "{capacity}% 󰚥";
format-alt = "{icon} {time}";
format-icons = ["󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹"];
};
memory = {
format = "{used:0.1f}G ";
tooltip-format = ''
RAM: {used:0.1f}G/{total:0.1f}G ({percentage}%)
Swap: {swapUsed:0.1f}G/{swapTotal:0.1f}G ({swapPercentage}%)'';
};
network = {
format = "{bandwidthDownBits} 󰇚 | {bandwidthUpBits} 󰕒";
interval = 3;
tooltip = false;
};
cpu = {
format = "{usage}% 󰍛";
interval = 3;
};
upower = {
icon-size = 16;
format = "{percentage}";
hide-if-empty = true;
tooltip = true;
tooltip-spacing = 20;
};
power-profiles-daemon = {
format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true;
format-icons = {
default = "󱡮";
performance = "󱡮";
balanced = "";
power-saver = "";
};
};
wireplumber = {
scroll-step = 3;
format = "{volume}% {icon}";
format-muted = "󰖁";
format-icons = ["󰕿" "󰖀" "󰕾"];
on-click = lib.getExe pkgs.pwvucontrol;
on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle";
};
"custom/launcher" = { "custom/launcher" = {
format = ""; format = "";
on-click = launcher; on-click = launcher;
tooltip = false; tooltip = false;
}; };
"custom/notification" = {
tooltip = false;
format = "{icon}";
format-icons = {
notification = "󱅫";
none = "󰂚";
dnd-notification = "󰂛";
dnd-none = "󰂛";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
escape = true;
};
"privacy" = {
icon-spacing = 0;
icon-size = 16;
transition-duration = 250;
screenshare = {
type = "screenshare";
tooltip = true;
tooltip-icon-size = 24;
};
audio-in = {
type = "audio-in";
tooltip = true;
tooltip-icon-size = 24;
};
};
"wlr/taskbar" = { "wlr/taskbar" = {
format = "{icon} {name}"; format = "{icon} {name}";
icon-size = 16; icon-size = 16;
@@ -178,32 +60,22 @@ in {
position = "top"; position = "top";
height = 33; height = 33;
spacing = 0; spacing = 0;
# margin-left = 36 + 3; margin-left = 36 + 3;
# margin-right = 36 + 3; margin-right = 36 + 3;
# margin-top = 3; margin-top = 3;
modules-left = [ modules-left = [
"custom/notification" "custom/notification"
"tray" "tray"
];
modules-center = ["clock"];
modules-right = [
"privacy" "privacy"
];
modules-right = [
"network" "network"
"cpu" "cpu"
"memory" "memory"
"wireplumber" "wireplumber"
(ifLaptop "group/laptop") (ifLaptop "group/laptop")
# "tray"
"idle_inhibitor" "idle_inhibitor"
]; ];
"niri/workspaces" = {
format = "{index}";
};
"niri/language" = {
format = "{}";
format-en = "🇺🇸";
format-uk = "🇺🇦";
};
"group/laptop" = { "group/laptop" = {
orientation = "inherit"; orientation = "inherit";
modules = [ modules = [
@@ -225,6 +97,7 @@ in {
]; ];
}; };
idle_inhibitor = { idle_inhibitor = {
tooltip = false;
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
activated = "󰅶"; activated = "󰅶";
@@ -235,12 +108,6 @@ in {
icon-size = 16; icon-size = 16;
spacing = 6; spacing = 6;
}; };
clock = {
interval = 1;
format = "{:%R}";
tooltip = true;
tooltip-format = "{:%B %d, %A}";
};
battery = { battery = {
states = { states = {
good = 95; good = 95;
@@ -269,17 +136,10 @@ in {
format = "{usage}% 󰍛"; format = "{usage}% 󰍛";
interval = 3; interval = 3;
}; };
upower = {
icon-size = 16;
format = "{percentage}";
hide-if-empty = true;
tooltip = true;
tooltip-spacing = 20;
};
power-profiles-daemon = { power-profiles-daemon = {
format = "{icon}"; format = "{icon}";
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
tooltip = true; tooltip = true;
tooltip-format = "Power profile: {profile}\nDriver: {driver}";
format-icons = { format-icons = {
default = "󱡮"; default = "󱡮";
performance = "󱡮"; performance = "󱡮";
@@ -295,11 +155,6 @@ in {
on-click = lib.getExe pkgs.pwvucontrol; on-click = lib.getExe pkgs.pwvucontrol;
on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle"; on-click-right = "wpctl set-mute @DEFAULT_SINK@ toggle";
}; };
"custom/launcher" = {
format = "";
on-click = launcher;
tooltip = false;
};
"custom/notification" = { "custom/notification" = {
tooltip = false; tooltip = false;
format = "{icon}"; format = "{icon}";
@@ -331,54 +186,62 @@ in {
tooltip-icon-size = 24; tooltip-icon-size = 24;
}; };
}; };
"wlr/taskbar" = {
format = "{icon} {name}";
icon-size = 18;
icon-theme = "${config.dconf.settings."org/gnome/desktop/interface".icon-theme}";
tooltip-format = "{title}";
on-click = "activate";
};
}; };
# TODO: figure out magic waybar css styling (does it pick up `~/.config/gtk-3.0/gtk.css` ?) # TODO: figure out magic waybar css styling (does it pick up `~/.config/gtk-3.0/gtk.css` ?)
style = style = let
colors = config.lib.stylix.colors.withHashtag;
in
# css # css
'' ''
@define-color base00 #${colors.base00}; @define-color base08 #${colors.base08}; @define-color base00 ${colors.base00}; @define-color base08 ${colors.base08};
@define-color base01 #${colors.base01}; @define-color base09 #${colors.base09}; @define-color base01 ${colors.base01}; @define-color base09 ${colors.base09};
@define-color base02 #${colors.base02}; @define-color base0A #${colors.base0A}; @define-color base02 ${colors.base02}; @define-color base0A ${colors.base0A};
@define-color base03 #${colors.base03}; @define-color base0B #${colors.base0B}; @define-color base03 ${colors.base03}; @define-color base0B ${colors.base0B};
@define-color base04 #${colors.base04}; @define-color base0C #${colors.base0C}; @define-color base04 ${colors.base04}; @define-color base0C ${colors.base0C};
@define-color base05 #${colors.base05}; @define-color base0D #${colors.base0D}; @define-color base05 ${colors.base05}; @define-color base0D ${colors.base0D};
@define-color base06 #${colors.base06}; @define-color base0E #${colors.base0E}; @define-color base06 ${colors.base06}; @define-color base0E ${colors.base0E};
@define-color base07 #${colors.base07}; @define-color base0F #${colors.base0F}; @define-color base07 ${colors.base07}; @define-color base0F ${colors.base0F};
* { * {
/* all: unset; */
font-family: Symbols Nerd Font, FontAwesome, ${config.stylix.fonts.sansSerif.name}; font-family: Symbols Nerd Font, FontAwesome, ${config.stylix.fonts.sansSerif.name};
font-weight: 500;
font-size: 16px; font-size: 16px;
font-weight: 500;
} }
.modules-left, .modules-center, .modules-right, window#waybar { .modules-left,
.modules-center,
.modules-right,
window#waybar {
background-color: @base00; background-color: @base00;
color: @base05; color: @base05;
border-radius: 12px; border-radius: 12px;
} }
window#waybar { .modules-left,
border-radius: 0; .modules-center,
.modules-right {
padding-left: 3px;
} /* for leftmost modules */
button {
border-radius: 6px;
box-shadow: inset 0 -3px transparent;
} }
/* for leftmost modules */ button:hover {
.modules-left, .modules-center, .modules-right { background: inherit;
padding-left: 3px; box-shadow: inset 0 -3px transparent;
background-color: @base00; }
label:focus {
background-color: #000000;
}
tooltip label {
color: @base05; color: @base05;
} }
window#bottom.modules-center {
background-color: transparent
}
tooltip { tooltip {
background: @base01; background: @base01;
border: 1px solid @base0D; border: 1px solid @base0D;
@@ -386,18 +249,8 @@ in {
padding: 2em; padding: 2em;
} }
tooltip label { window#bottom.modules-center {
color: @base05; background-color: transparent
}
button {
box-shadow: inset 0 -3px transparent;
border-radius: 6px;
}
button:hover {
background: inherit;
box-shadow: inset 0 -3px transparent;
} }
#backlight, #backlight,
@@ -415,7 +268,6 @@ in {
#privacy-item, #privacy-item,
#taskbar button, #taskbar button,
#taskbar, #taskbar,
#tray button,
#tray, #tray,
#wireplumber, #wireplumber,
#workspaces button, #workspaces button,
@@ -425,7 +277,6 @@ in {
background-color: @base01; background-color: @base01;
margin: 3px 3px 3px 0; margin: 3px 3px 3px 0;
padding: 0 0.42em; padding: 0 0.42em;
min-width: 1em;
} }
#backlight, #backlight,
@@ -437,40 +288,21 @@ in {
#wireplumber { #wireplumber {
padding: 0 0.5em; padding: 0 0.5em;
} }
#custom-notification,
#power-profiles-daemon {
min-width: 1em;
}
#privacy,
#taskbar,
#workspaces {
padding: 0;
}
#workspaces {
padding-left: 3px;
}
#privacy-item {
padding: 0 0.3em;
}
#taskbar button {
padding-left: 0;
}
#taskbar button,
#tray button,
#workspaces button {
border-radius: 6px;
min-width: 0.8em;
}
#battery.critical:not(.charging) { #battery.critical:not(.charging) {
background-color: @base09; background-color: @base09;
color: @base00; color: @base00;
} }
#custom-launcher,
#custom-notification,
#idle_inhibitor,
#language,
#power-profiles-daemon {
padding: 0;
min-width: 1.7em;
}
#power-profiles-daemon.performance { #power-profiles-daemon.performance {
background-color: @base0D; background-color: @base0D;
color: @base00; color: @base00;
@@ -481,6 +313,20 @@ in {
color: @base00; color: @base00;
} }
#privacy,
#taskbar,
#workspaces {
padding: 0;
}
#privacy-item,
#taskbar button,
#workspaces button {
border-radius: 6px;
min-width: 1.4em;
padding: 0;
}
#privacy-item.audio-in { #privacy-item.audio-in {
background-color: @base0E; background-color: @base0E;
color: @base00; color: @base00;
@@ -490,24 +336,27 @@ in {
#privacy-item.screenshare { #privacy-item.screenshare {
background-color: @base0C; background-color: @base0C;
color: @base00; color: @base00;
margin: 3px 0 3px 3px; margin-right: 0;
} }
#taskbar button, #taskbar button {
#tray button { padding-left: 0;
}
#taskbar button {
padding: 0 0.4em; padding: 0 0.4em;
margin: 3px; margin: 3px;
} }
#workspaces button.active, #taskbar button.active,
#taskbar button.active { #workspaces button.active {
background-color: @base02; background-color: @base02;
} }
#workspaces button:hover,
#workspaces button.active:hover,
#taskbar button.active:hover, #taskbar button.active:hover,
#taskbar button:hover { #taskbar button:hover,
#workspaces button:hover,
#workspaces button.active:hover {
background-color: @base0D; background-color: @base0D;
color: @base00; color: @base00;
} }
@@ -516,22 +365,17 @@ in {
background-color: transparent; background-color: transparent;
} }
#tray > .needs-attention { #tray>.needs-attention {
-gtk-icon-effect: highlight; -gtk-icon-effect: highlight;
background-color: @base08; background-color: @base08;
} }
#tray > .passive { #tray>.passive {
-gtk-icon-effect: dim; -gtk-icon-effect: dim;
} }
/* #workspaces button.active { #workspaces {
color: @base00; padding-left: 3px;
background-color: @base0D;
} */
label:focus {
background-color: #000000;
} }
''; '';
} }