home-manager: move waybar into module
This commit is contained in:
parent
6804557581
commit
2c8d1522b1
3 changed files with 106 additions and 106 deletions
203
home-manager/modules/waybar.css
Normal file
203
home-manager/modules/waybar.css
Normal file
|
@ -0,0 +1,203 @@
|
|||
/* =============================================================================
|
||||
*
|
||||
* Waybar configuration
|
||||
*
|
||||
* Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
|
||||
*
|
||||
* =========================================================================== */
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Keyframes
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
@keyframes blink-warning {
|
||||
70% {
|
||||
color: @light;
|
||||
}
|
||||
|
||||
to {
|
||||
color: @light;
|
||||
background-color: @warning;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blink-critical {
|
||||
70% {
|
||||
color: @light;
|
||||
}
|
||||
|
||||
to {
|
||||
color: @light;
|
||||
background-color: @critical;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Styles
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
/* COLORS */
|
||||
|
||||
/* Gruvbox */
|
||||
@define-color light #ebdbb2;
|
||||
@define-color dark #1d2021;
|
||||
|
||||
@define-color warning #fabd2f;
|
||||
@define-color critical #fb4934;
|
||||
|
||||
@define-color red #fb4934;
|
||||
@define-color orange #fe8019;
|
||||
@define-color green #b8bb26;
|
||||
@define-color yellow #fabd2f;
|
||||
@define-color blue #83a598;
|
||||
@define-color purple #d3869b;
|
||||
@define-color teal #8ec07c;
|
||||
@define-color gray #928374;
|
||||
|
||||
/* Reset all styles */
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* The whole bar */
|
||||
#waybar {
|
||||
background: @dark;
|
||||
color: @light;
|
||||
font-family: Inconsolata, Inconsolata Nerd Font, FiraCode Nerd Font Mono;
|
||||
font-size: 14pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* All modules */
|
||||
#battery,
|
||||
#clock,
|
||||
#cpu,
|
||||
#memory,
|
||||
#mode,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#temperature,
|
||||
#tray {
|
||||
background: transparent;
|
||||
color: @light;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
/* All module that should blink */
|
||||
#mode
|
||||
#memory,
|
||||
#temperature,
|
||||
#battery {
|
||||
animation-timing-function: linear;
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
/* All critical modules */
|
||||
#memory.critical,
|
||||
#cpu.critical,
|
||||
#temperature.critical,
|
||||
#battery.critical {
|
||||
color: @critical;
|
||||
}
|
||||
|
||||
/* All critical modules that should blink */
|
||||
#mode,
|
||||
#memory.critical,
|
||||
#temperature.critical,
|
||||
#battery.critical.discharging {
|
||||
animation-name: blink-critical;
|
||||
animation-duration: 2s;
|
||||
}
|
||||
|
||||
/* Each warning */
|
||||
#network.disconnected,
|
||||
#memory.warning,
|
||||
#cpu.warning,
|
||||
#temperature.warning,
|
||||
#battery.warning {
|
||||
color: @warning;
|
||||
}
|
||||
|
||||
/* Each warning that should blink */
|
||||
#battery.warning.discharging {
|
||||
animation-name: blink-warning;
|
||||
animation-duration: 3s;
|
||||
}
|
||||
|
||||
/* And now modules themselves in their respective order */
|
||||
|
||||
/* Workspaces stuff */
|
||||
#workspaces button {
|
||||
/*font-weight: bold;*/
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
color: @light;
|
||||
background: @dark;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
border-bottom: 2px solid @orange;
|
||||
}
|
||||
|
||||
#workspaces button.visible:not(.focused) {
|
||||
border-bottom: 2px solid @gray;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: @orange;
|
||||
}
|
||||
|
||||
#mode { /* Shows current Sway mode (resize etc.) */
|
||||
padding-left: 10px;
|
||||
color: @light;
|
||||
background: @red;
|
||||
}
|
||||
|
||||
#window {
|
||||
margin-right: 30px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
border-bottom: 2px solid @red;
|
||||
}
|
||||
|
||||
#network {
|
||||
border-bottom: 2px solid @orange;
|
||||
}
|
||||
|
||||
#memory {
|
||||
border-bottom: 2px solid @yellow;
|
||||
}
|
||||
|
||||
#cpu {
|
||||
border-bottom: 2px solid @green;
|
||||
}
|
||||
|
||||
#temperature {
|
||||
border-bottom: 2px solid @teal;
|
||||
}
|
||||
|
||||
#battery {
|
||||
border-bottom: 2px solid @blue;
|
||||
}
|
||||
|
||||
#tray {
|
||||
}
|
||||
|
||||
#clock {
|
||||
border-bottom: 2px solid @light;
|
||||
}
|
||||
|
||||
#pulseaudio.muted {
|
||||
/* No styles */
|
||||
}
|
||||
|
105
home-manager/modules/waybar.nix
Normal file
105
home-manager/modules/waybar.nix
Normal file
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
settings = [{
|
||||
layer = "top";
|
||||
position = "bottom";
|
||||
height = 28;
|
||||
modules-left = [
|
||||
"sway/workspaces"
|
||||
"sway/window"
|
||||
];
|
||||
modules-center = [
|
||||
];
|
||||
modules-right = [
|
||||
"disk"
|
||||
"pulseaudio"
|
||||
"network"
|
||||
"memory"
|
||||
"cpu"
|
||||
"temperature"
|
||||
"battery"
|
||||
"tray"
|
||||
"clock"
|
||||
];
|
||||
modules = {
|
||||
"battery" = {
|
||||
states = {
|
||||
warning = 20;
|
||||
critical = 10;
|
||||
};
|
||||
format = " {capacity}%";
|
||||
format-discharging = "{icon} {capacity}%";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
"cpu" = {
|
||||
format = " {}";
|
||||
};
|
||||
"clock" = {
|
||||
format = "{:%H:%M}";
|
||||
tooltip = false;
|
||||
};
|
||||
"memory" = {
|
||||
interval = 5;
|
||||
format = " {}%";
|
||||
tooltip-format = "{used:0.1f}/{total:0.1f} GB";
|
||||
states = {
|
||||
warning = 80;
|
||||
critical = 90;
|
||||
};
|
||||
};
|
||||
"network" = {
|
||||
interface = "wl*";
|
||||
format-wifi = " {essid}";
|
||||
format-icons = [
|
||||
""
|
||||
];
|
||||
tooltip-format-wifi = "{frequency} MHz, {signaldBm} dBm";
|
||||
};
|
||||
"pulseaudio" = {
|
||||
scroll-step = 1;
|
||||
format = "{icon} {volume}%";
|
||||
format-bluetooth = "{icon} {volume}% ";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphones = "";
|
||||
handsfree = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = [ "" "" ];
|
||||
};
|
||||
on-click = "pavucontrol";
|
||||
};
|
||||
"sway/workspaces" = {
|
||||
all-outputs = false;
|
||||
disable-scroll = false;
|
||||
format = "{name}";
|
||||
};
|
||||
"temperature" = {
|
||||
format = " {temperatureC}°C";
|
||||
hwmon-path = "/sys/class/hwmon/hwmon3/temp1_input";
|
||||
critical-threshold = 75;
|
||||
};
|
||||
"disk" = {
|
||||
interval = 30;
|
||||
format = "{free} free";
|
||||
path = "/";
|
||||
};
|
||||
};
|
||||
}];
|
||||
style = builtins.readFile ./waybar.css;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue