nix/modules/home/gui/hyprland/waybar.nix

158 lines
3.9 KiB
Nix
Raw Normal View History

2024-06-25 13:11:30 +02:00
{ pkgs, lib, config, ... }:
2024-03-09 17:18:36 +01:00
{
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 32;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [
"clock"
];
modules-right = [
"tray"
2024-03-12 17:31:56 +01:00
"network"
2024-03-09 17:18:36 +01:00
"pulseaudio"
"battery"
];
# Modules left
"hyprland/workspaces" = {
"format" = "{icon}";
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
"on-click" = "activate";
2024-06-25 13:11:30 +02:00
"persistent-workspaces" = lib.mkMerge [{
}
(lib.mkIf (config.host == "xv-laptop") {
2024-06-18 11:22:58 +02:00
"DP-10" = [ 1 2 3 4 ];
"DP-9" = [ 5 6 7 ];
"eDP-1" = [ 8 9 10 ];
2024-09-12 18:43:03 +02:00
})
(lib.mkIf (config.host == "xv-desktop") {
"DP-1" = [ 1 2 3 4 5 ];
"HDMI-A-1" = [ 6 7 8 9 10 ];
2024-06-25 13:11:30 +02:00
})];
2024-03-09 17:18:36 +01:00
"format-icons" = {
"default" = "";
"empty" = "";
"active" = "";
};
};
"hyprland/window" = {
"max-length" = 200;
"seperate-outputs" = true;
};
# Modules middle
"clock" = {
"interval" = 1;
"format" = "{:%a %d %b | %H:%M:%S}";
};
# Modules right
"tray" = {
"spacing" = 10;
"icon-size" = 21;
};
"battery" = {
"bat" = "BAT1";
"interval" = 60;
"states" = {
"warning" = 30;
"critical" = 15;
};
"format" = "{icon} {capacity}%";
"format-icons" = [ "" "" "" "" "" ];
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-bluetooth" = "{volume}% {icon}";
"format-muted" = "󰝟";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = ["" ""];
};
"scroll-step" = 1;
"on-click" = "pavucontrol";
"ignored-sinks" = ["Easy Effects Sink"];
};
2024-03-12 17:31:56 +01:00
"network" = {
"interface" = "wlan0";
"format" = "{ifname}";
"format-wifi" = " {essid}";
"format-ethernet" = "󰊗 {ipaddr}/{cidr}";
"format-disconnected" = "";
"tooltip-format" = "{ifname} via {gwaddr}";
"tooltip-format-wifi" = "{essid} ({signalStrength}%)";
"tooltip-format-ethernet" = "{ifname}";
"tooltip-format-disconnected" = "Disconnected";
"max-length" = 50;
};
2024-03-09 17:18:36 +01:00
};
};
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: DejaVuSansM Nerd Font;
}
2024-03-12 17:31:56 +01:00
#workspaces,#window,#clock,#battery,#tray,#pulseaudio,#network {
2024-03-09 17:18:36 +01:00
background-color: @theme_bg_color;
border-radius: 50px;
padding: 0px 15px;
margin: 5px 3px 0px 3px;
}
#workspaces {
margin-left: 10px;
padding: 0px 5px;
font-size: 15px;
}
window#waybar.empty #window {
background-color: transparent;
}
window#waybar {
background-color: transparent;
font-size: 12px;
}
#workspaces button.active {
color: @theme_text_color;
}
#workspaces button {
color: shade(@theme_text_color, 0.5);
padding: 2px 5px;
}
#battery {
margin-right: 10px;
}
#battery.warning {
background-color: #ff8000;
}
#battery.critical {
background-color: #f00;
}
'';
};
}