diff --git a/home/config/waybar/config/default.nix b/home/config/waybar/config/default.nix index 14a6296..c5e6f88 100644 --- a/home/config/waybar/config/default.nix +++ b/home/config/waybar/config/default.nix @@ -128,17 +128,19 @@ in { }; }; cpu = { - format = "{usage}% ({load})"; - interval = refreshInterval; - on-click = "foot -e bash -c btop"; - on-click-right = "powersave toggle"; - tooltip = false; + format = "{usage}% ({load})"; + interval = refreshInterval; + on-click = "foot -e bash -c btop"; + on-click-right = "powersave toggle"; + states.critical = 80; + tooltip = false; }; memory = { - format = "{percentage}%"; - interval = refreshInterval; - on-click = "foot -e bash -c btop"; - on-click-right = "powersave toggle"; + format = "{percentage}%"; + interval = refreshInterval; + on-click = "foot -e bash -c btop"; + on-click-right = "powersave toggle"; + states.critical = 80; }; temperature = { critical-threshold = 80; @@ -160,10 +162,12 @@ in { "group/hardware" = { orientation = "horizontal"; modules = [ + "custom/tag1" "cpu" "temperature" "memory" "custom/powersave" + "custom/tag2" ]; }; "custom/display" = { @@ -174,5 +178,11 @@ in { return-type = "json"; signal = 4; }; + "custom/tag1" = { + exec = "echo ​"; + }; + "custom/tag2" = { + exec = "echo ​"; + }; }; } diff --git a/home/config/waybar/style/Plugin.nix b/home/config/waybar/style/Plugin.nix index 8627a66..af7fab2 100644 --- a/home/config/waybar/style/Plugin.nix +++ b/home/config/waybar/style/Plugin.nix @@ -9,6 +9,18 @@ in { # This way I am forced to apply the padding to children of each group # instead of the whole group. text = '' + /* See the ISSUE above. */ + #custom-tag1, + #battery { + padding-left: ${paddingH}; + } + + #custom-tag2, + #custom-powerlimit { + padding-right: ${paddingH}; + } + + /* Padding for global widgets. */ #clock, #custom-display, #language, @@ -17,33 +29,17 @@ in { #scratchpad, #tray { padding: ${paddingV} ${paddingH}; - border-top: ${toString config.module.style.window.border}px solid transparent; - border-bottom: ${toString config.module.style.window.border}px solid transparent; - } - - #cpu, - #battery { - padding-left: ${paddingH}; - } - - #custom-powersave, - #custom-powerlimit { - padding-right: ${paddingH}; - } - - #clock { - font-weight: bold; } + /* Padding for combined widgets. */ #custom-powerlimit, #custom-powersave, #memory, #temperature { padding-left: 4px; - border-top: ${toString config.module.style.window.border}px solid transparent; - border-bottom: ${toString config.module.style.window.border}px solid transparent; } + /* Hover style. */ #batteryinfo:hover, #clock:hover, #custom-display:hover, @@ -57,15 +53,30 @@ in { background-color: rgba(${config.module.style.color.border-r},${config.module.style.color.border-g},${config.module.style.color.border-b},${toString config.module.style.opacity.desktop}); } + /* Critical state. */ + #battery, + #cpu, + #custom-display, + #memory, + #pulseaudio, + #temperature, + #tray { + border-top: ${toString config.module.style.window.border}px solid transparent; + border-bottom: ${toString config.module.style.window.border}px solid transparent; + } + + #battery.critical, + #cpu.critical, + #custom-display.modified, + #memory.critical, #pulseaudio.muted, #pulseaudio.source-muted, - #battery.critical, #temperature.critical, - #tray.needs-attention, - #custom-display.modified { + #tray.needs-attention { border-top: ${toString config.module.style.window.border}px solid #${config.module.style.color.accent}; } + /* Widget-specific styling. */ #workspaces button { padding: ${paddingV} 4px; border-top: ${toString config.module.style.window.border}px solid transparent; @@ -76,5 +87,9 @@ in { #workspaces button.focused { border-top: ${toString config.module.style.window.border}px solid #${config.module.style.color.accent}; } + + #clock { + font-weight: bold; + } ''; }