dotfiles/home/apps/waybar.nix

150 lines
3.1 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
config,
lib,
pkgs,
...
}:
let
commonSettings = {
layer = "top";
position = "top";
height = 32;
spacing = 2;
margin = "2";
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
"idle_inhibitor"
"pulseaudio"
"clock"
];
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "󰒲";
};
};
tray.spacing = 10;
pulseaudio = {
format = "{icon} {volume}%";
format-icons.default = [
""
""
""
];
on-click = "pavucontrol";
};
};
darkColors = ''
@define-color red #f38ba8;
@define-color pink #f5c2e7;
@define-color crust #11111c;
@define-color base #1e1e2e;
@define-color text #cdd6f4;
@define-color surface0 #313244;
@define-color surface2 #585b70;
'';
lightColors = ''
@define-color red #d20f39;
@define-color pink #ea76cb;
@define-color crust #dce0e8;
@define-color base #eff1f5;
@define-color text #4c4f69;
@define-color surface0 #ccd0da;
@define-color surface2 #acb0be;
'';
style = ''
* {
font-family: Symbols Nerd Font, IBM Plex Sans;
font-size: 16px;
color: @text;
}
window#waybar {
background-color: @base;
border: 2px solid @crust;
border-radius: 5px;
}
#workspaces button:first-child {
padding: 0 5px;
border-radius: 5px 0 0 5px;
border-left: 2px solid @crust;
}
#workspaces button.active:first-child {
padding: 0 5px;
box-shadow: unset;
border-radius: 5px 0 0 5px;
border-left: 2px solid @pink;
border-top: 2px solid @pink;
border-bottom: 2px solid @pink;
}
#workspaces button {
padding: 0 5px;
border-radius: 0;
border-top: 2px solid @crust;
border-bottom: 2px solid @crust;
}
#workspaces button:hover {
background: @surface2;
}
#workspaces button.active {
color: @pink;
background: @surface0;
border-top: 2px solid @pink;
border-bottom: 2px solid @pink;
}
#workspaces button.urgent {
background-color: @red;
}
#clock, #network, #pulseaudio, #tray, #idle_inhibitor {
padding: 0 10px;
}
'';
in
{
config = lib.mkIf (config.isGraphical && pkgs.stdenv.isLinux) {
programs.waybar = {
enable = true;
settings = {
hyprland = commonSettings // {
modules-left = [ "hyprland/workspaces" ];
"hyprland/workspaces" = {
format = "{icon}";
on-click = "activate";
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"10" = "";
};
persistent-workspaces."*" = 10;
};
};
};
};
xdg.configFile = {
"waybar/style-dark.css".text = darkColors + style;
"waybar/style-light.css".text = lightColors + style;
};
};
}