waybar redo
This commit is contained in:
parent
0b21647b2b
commit
f5a8935507
14 changed files with 223 additions and 72 deletions
79
modules/waybar/battery.nix
Normal file
79
modules/waybar/battery.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
name = "battery";
|
||||
in
|
||||
{
|
||||
options.modules.waybar.modules = import ./addname.nix lib name;
|
||||
options.modules.waybar.enabled.${name} = {
|
||||
enable = lib.mkEnableOption "enable ${name} waybar module";
|
||||
};
|
||||
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
|
||||
programs.waybar = {
|
||||
settings.mainBar.${name} = {
|
||||
states = {
|
||||
full = 100;
|
||||
good = 99;
|
||||
warning = 30;
|
||||
critical = 15;
|
||||
};
|
||||
format = "{capacity}% {icon}";
|
||||
format-charging = "{capacity}% {icon}";
|
||||
format-plugged = "{capacity}% {icon}";
|
||||
format-alt = "{time} {icon}";
|
||||
|
||||
interval = 1;
|
||||
format-full = "";
|
||||
format-icons = [
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
""
|
||||
];
|
||||
};
|
||||
style = ''
|
||||
#battery {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
margin: 5px 2px;
|
||||
padding: 0 12px;
|
||||
border-radius: 999px;
|
||||
min-width: 40px;
|
||||
transition: all 0.3s;
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
}
|
||||
|
||||
#battery.charging,
|
||||
#battery.plugged,
|
||||
#battery.full {
|
||||
color: #${config.colorScheme.palette.taskbarText};
|
||||
background-color: #${config.colorScheme.palette.taskbarBackground};
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: transparent;
|
||||
animation: batteryCritical 1.2s linear 0s infinite normal forwards;
|
||||
}
|
||||
|
||||
@keyframes batteryCritical {
|
||||
0% {
|
||||
background-color: #${config.colorScheme.palette.base08};
|
||||
color: #${config.colorScheme.palette.base06};
|
||||
}
|
||||
50% {
|
||||
background-color: #${config.colorScheme.palette.base02};
|
||||
color: #${config.colorScheme.palette.base08};
|
||||
}
|
||||
100% {
|
||||
background-color: #${config.colorScheme.palette.base08};
|
||||
color: #${config.colorScheme.palette.base06};
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue