Add idle_inhibitor to waybar

This commit is contained in:
Malte Tammena 2021-06-11 19:04:13 +02:00
parent cf53c6f859
commit 4d82643d8e

View file

@ -1,6 +1,13 @@
{ ... }:
{
let
colBg = "#282828";
colFg = "#ebdbb2";
colFgDimmed = "#928374";
colWarn = "#d79921";
in {
programs.waybar = {
enable = true;
@ -10,14 +17,14 @@
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "clock#time" "clock#date" ];
modules-right = [ "network" "battery" "tray" ];
modules-right = [ "idle_inhibitor" "network" "battery" "tray" ];
modules = {
"sway/workspaces" = {
disable-scroll = true;
all-outputs = true;
};
"sway/mode" = { format = "<span foreground='#282828'>{}</span>"; };
"sway/mode" = { format = "<span foreground='${colBg}'>{}</span>"; };
"clock#time" = {
interval = 1;
@ -29,6 +36,14 @@
tooltip = false;
};
"idle_inhibitor" = {
format = "{icon}";
format-icons = {
activated = " ";
deactivated = " ";
};
tooltip = false;
};
"battery" = {
states = {
good = 95;
@ -63,9 +78,9 @@
}
window#waybar {
background-color: #282828;
background-color: ${colBg};
border-bottom: 1px solid #3c3836;
color: #ebdbb2;
color: ${colFg};
}
window#waybar.hidden {
@ -92,9 +107,9 @@
}
#workspaces button:hover {
background-color: #ebdbb2;
background-color: ${colFg};
background-image: none;
color: #282828;
color: ${colBg};
}
#workspaces button.current_output {
@ -102,18 +117,18 @@
}
#workspaces button.visible {
color: #282828;
color: ${colBg};
background-color: #928374;
}
#workspaces button.current_output.visible {
background-color: transparent;
color: #ebdbb2;
color: ${colFg};
}
#workspaces button.current_output.focused {
background-color: #ebdbb2;
color: #282828;
background-color: ${colFg};
color: ${colBg};
}
#workspaces button.urgent {
@ -122,7 +137,7 @@
#mode {
background-color: #fe8019;
color: #282828;
color: ${colBg};
box-shadow: inset 0 -1px #d65d0e;
}
@ -136,10 +151,23 @@
#pulseaudio,
#custom-media,
#mode,
#idle_inhibitor,
#mpd {
padding: 0 10px;
color: #ebdbb2;
color: ${colFg};
}
#idle_inhibitor {
padding: 0px 10px 0px 13px;
font-weight: bolder;
}
#idle_inhibitor.deactivated {
color: ${colFgDimmed};
}
#idle_inhibitor.activated {
/* background-color: ${colWarn}; */
color: ${colWarn};
}
#clock.time {
@ -172,12 +200,12 @@
#battery.warning:not(.charging) {
background-color: #fe8019;
color: #282828;
color: ${colBg};
}
#battery.critical:not(.charging) {
background-color: #fb4934;
color: #282828;
color: ${colBg};
}
label:focus {
@ -236,9 +264,9 @@
}
#tray menu {
background-color: #282828;
color: #ebdbb2;
border: 1px solid #ebdbb2;
background-color: ${colBg};
color: ${colFg};
border: 1px solid ${colFg};
padding: 0;
margin: 10px;
font-weight: bold;
@ -253,17 +281,8 @@
}
#tray menu menuitem:hover {
background-color: #ebdbb2;
color: #282828;
}
#idle_inhibitor {
background-color: #2d3436;
}
#idle_inhibitor.activated {
background-color: #ecf0f1;
color: #2d3436;
background-color: ${colFg};
color: ${colBg};
}
#mpd {