feat(waybar): add simple bar config
This commit is contained in:
parent
82265ddca2
commit
7e1ab4a0cf
1 changed files with 126 additions and 1 deletions
|
|
@ -1,7 +1,9 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.homeModules.desktop.wayland.bar.waybar;
|
cfg = config.homeModules.desktop.wayland.bar.waybar;
|
||||||
|
monitorWidth = (lib.head config.monitors).width - 20;
|
||||||
|
inherit (config.colorscheme) colors;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -9,6 +11,129 @@ in
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
package = pkgs.waybar;
|
||||||
|
|
||||||
|
settings.mainBar = {
|
||||||
|
layer = "top";
|
||||||
|
position = "top";
|
||||||
|
height = 30;
|
||||||
|
width = monitorWidth;
|
||||||
|
exclusive = true;
|
||||||
|
margin-top = 10;
|
||||||
|
margin-bottom = -12;
|
||||||
|
|
||||||
|
modules-left = [ "clock" "battery" "hyprland/workspaces" ];
|
||||||
|
modules-center = [];
|
||||||
|
modules-right = [ "tray" ];
|
||||||
|
|
||||||
|
"hyprland/workspaces" = let
|
||||||
|
hyprctl = config.wayland.windowManager.hyprland.package + "/bin/hyprctl";
|
||||||
|
in {
|
||||||
|
on-click = "activate";
|
||||||
|
on-scroll-up = "${hyprctl} dispatch workspace m+1";
|
||||||
|
on-scroll-down = "${hyprctl} dispatch workspace m-1";
|
||||||
|
format = "{icon}";
|
||||||
|
active-only = false;
|
||||||
|
persistent-workspaces = {
|
||||||
|
"*" = 5;
|
||||||
|
};
|
||||||
|
format-icons = {
|
||||||
|
active = "";
|
||||||
|
default = "";
|
||||||
|
urgent = "";
|
||||||
|
};
|
||||||
|
all-outputs = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
clock = {
|
||||||
|
format = "{:%I:%M %p}";
|
||||||
|
format-alt = "{:%Y-%m-%d}";
|
||||||
|
};
|
||||||
|
battery = {
|
||||||
|
states = {
|
||||||
|
good = 100;
|
||||||
|
warning = 35;
|
||||||
|
critical = 15;
|
||||||
|
};
|
||||||
|
bat = "BAT0";
|
||||||
|
interval = 10;
|
||||||
|
format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
|
||||||
|
format = "{icon} {capacity}%";
|
||||||
|
format-charging = "{icon} {capacity}%";
|
||||||
|
tooltip-format = "{timeTo} {power}W";
|
||||||
|
};
|
||||||
|
tray = {
|
||||||
|
icon-size = 21;
|
||||||
|
spacing = 5;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
style = /* css */ ''
|
||||||
|
* {
|
||||||
|
font-family: "${config.fontProfiles.monospace.family}";
|
||||||
|
font-size: 19px;
|
||||||
|
border: solid #${colors.base05};
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar {
|
||||||
|
background-color: transparent;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock,
|
||||||
|
#battery,
|
||||||
|
#workspaces {
|
||||||
|
background-color: #${colors.base00};
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
padding-left: 10px;
|
||||||
|
border: 2px solid #${colors.base05};
|
||||||
|
border-right: 0px;
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery {
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
border-top: 2px solid #${colors.base05};
|
||||||
|
border-bottom: 2px solid #${colors.base05};
|
||||||
|
border-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.good {
|
||||||
|
color: #${colors.base0B};
|
||||||
|
}
|
||||||
|
#battery.warning {
|
||||||
|
color: #${colors.base0A};
|
||||||
|
}
|
||||||
|
#battery.critical {
|
||||||
|
color: #${colors.base08};
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray {
|
||||||
|
padding-right: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces {
|
||||||
|
border: 2px solid #${colors.base05};
|
||||||
|
border-left: 0;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspace button,
|
||||||
|
#workspaces button.active,
|
||||||
|
#workspaces button.visible {
|
||||||
|
color: #${colors.base0B};
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent {
|
||||||
|
color: #${colors.base08};
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue