nix/home/waybar/default.nix
2024-07-02 22:10:44 +02:00

298 lines
5.1 KiB
Nix

{
pkgs,
config,
...
}: let
workspaces = {
};
mainWaybarConfig = {
mod = "dock";
layer = "top";
gtk-layer-shell = true;
height = 14;
position = "top";
modules-left = ["hyprland/workspaces"];
modules-center = ["clock"];
modules-right = [
"pulseaudio"
"tray"
];
"wlr/workspaces" = workspaces;
"hyprland/workspaces" = workspaces;
clock = {
actions = {
on-click-forward = "tz_up";
on-click-right = "mode";
on-scroll-down = "shift_down";
on-scroll-up = "shift_up";
};
};
pulseaudio = {
format = "{icon} {volume}%";
on-click = "pavucontrol";
format-icons = {
default = ["" "" ""];
};
};
tray = {
icon-size = 15;
spacing = 5;
};
};
css = ''
/* -----------------------------------------------------
* General
* ----------------------------------------------------- */
* {
font-size: 16px;
font-family: Ubuntu Nerd Font, Font Awesome, sans-serif;
font-weight: bold;
}
window#waybar {
background-color: rgba(26,27,38,0.4);
border-bottom: 1px solid rgba(26,27,38,0);
border-radius: 0px;
color: #f8f8f2;
}
/* -----------------------------------------------------
* Workspaces
* ----------------------------------------------------- */
#workspaces {
background: #458588;
margin: 5px 3px 5px 12px;
padding: 0px 1px;
border-radius: 15px;
border: 0px;
font-style: normal;
color: #15161e;
}
#workspaces button {
padding: 0px 5px;
margin: 4px 3px;
border-radius: 15px;
border: 0px;
color: #15161e;
background-color: #458588;
opacity: 0.5;
transition: all 0.3s ease-in-out;
}
#workspaces button.active {
color: #15161e;
* {
border: none;
border-radius: 0px;
font-family: "Inconsolata";
font-size: 16px;
min-height: 0;
color: #ebdbb2;
}
window#waybar {
border-bottom-style: inset;
border-bottom: 4px solid #689d6a;
background: #1d2021;
}
#workspaces, #clock, #custom-music, #window {
font-weight: 800;
}
/* Workspace Buttons */
#workspaces button label{
color: #689d6a;
}
#workspaces button.focused label {
color: #1d2021;
}
#workspaces button.focused {
background: #689d6a;
}
#mode {
background-color: #cc241d;
color: white;
}
#clock, #battery, #cpu, #memory, #network, #pulseaudio, #tray, #mode, #idle_inhibitor {
padding: 0 5px;
margin: 0 10px;
}
#idle_inhibitor {
padding: 0 10px;
}
#idle_inhibitor.activated {
background-color: #689d6a;
color: #1d2021;
}
#custom-music {
color: #b8bb26;
margin: 0 15px;
padding: 0 20px;
border-bottom: 4px solid #b8bb26;
}
#clock {
margin: 0;
color: #fabd2f;
border-bottom: 4px solid #fabd2f;
}
#network.disconnected {
color: #cc241d;
border-bottom: 4px solid #cc241d;
}
#pulseaudio.muted {
padding: 0 20px;
color: #cc241d;
border-bottom: 4px solid #cc241d;
}
background: #458588;
border-radius: 15px;
min-width: 40px;
transition: all 0.3s ease-in-out;
opacity: 1.0;
}
#workspaces button:hover {
color: #15161e;
background: #458588;
border-radius: 15px;
opacity: 1.0;
}
/* -----------------------------------------------------
* Tooltips
* ----------------------------------------------------- */
tooltip {
background: #282828;
border: 1px solid #282828;
border-radius: 10px;
}
tooltip label {
color: #15161e;
}
/* -----------------------------------------------------
* Window
* ----------------------------------------------------- */
#window {
color: #15161e;
background: #8ec07c;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#custom-packages {
color: #15161e;
background: #f7768e;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#memory {
color: #15161e;
background: #e0af68;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#clock {
color: #15161e;
background: #458588;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#cpu {
color: #15161e;
background: #7dcfff;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#disk {
color: #15161e;
background: #9ece6a;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#battery {
color: #15161e;
background: #ff79c6;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#network {
color: #15161e;
background: #f1fa8c;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#tray {
color: #15161e;
background: #8EC07C;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#pulseaudio {
color: #15161e;
background: #458588;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
#custom-notification {
color: #15161e;
background: #6272a4;
border-radius: 15px;
margin: 5px;
padding: 2px 10px;
}
'';
in {
programs.waybar = {
enable = true;
package = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ ["-Dexperimental=true"];
});
style = css;
settings = {mainBar = mainWaybarConfig;};
};
}