nixos-config/users/rouven/modules/hyprland/waybar.nix

203 lines
5.5 KiB
Nix
Raw Normal View History

2023-06-03 21:42:12 +02:00
{ self, config, pkgs, hyprland, ... }:
2023-01-20 21:43:16 +01:00
{
2023-06-05 12:31:07 +02:00
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.hyprland}/bin";
2023-01-20 21:43:16 +01:00
programs.waybar = {
enable = true;
2023-02-21 12:24:34 +01:00
systemd.enable = true;
2023-05-14 12:39:19 +02:00
package = hyprland.packages.x86_64-linux.waybar-hyprland;
2023-01-20 21:43:16 +01:00
settings = {
mainBar = {
layer = "top";
position = "top";
height = 26;
2023-06-04 12:22:09 +02:00
modules-left = [ "wlr/workspaces" "custom/spotifytitle" "hyprland/window" ];
2023-01-20 21:43:16 +01:00
modules-right = [ "network" "cpu" "temperature" "pulseaudio" "battery" "tray" "clock" ];
network = {
2023-02-25 16:30:02 +01:00
format-wifi = " {essid} ({signalStrength}%)";
2023-02-25 22:28:04 +01:00
format-ethernet = "󰈀 {ipaddr}/{cidr}";
tooltip-format = "󰈀 {ifname} via {gwaddr}";
format-linked = "󰈀 {ifname} (No IP)";
2023-01-20 21:43:16 +01:00
format-disconnected = "Disconnected ";
format-alt = "{ifname}: {ipaddr}/{cidr}";
};
2023-05-18 23:17:26 +02:00
"wlr/workspaces" = {
format = "{icon}";
on-click = "activate";
};
"hyprland/window" = {
format = " {}";
separate-outputs = true;
};
2023-06-03 21:42:12 +02:00
"custom/spotifytitle" = {
format = " {}";
max-length = 80;
return-type = "json";
2023-06-05 12:31:07 +02:00
exec = "${self.packages.x86_64-linux.pww}/bin/pww -w spotifyd:title -p None 2> /dev/null";
2023-06-03 21:42:12 +02:00
};
2023-01-20 21:43:16 +01:00
cpu = {
format = "{usage}% ";
};
temperature = {
2023-05-18 23:17:26 +02:00
hwmon-path = "/sys/class/hwmon/hwmon5/temp1_input";
2023-01-20 21:43:16 +01:00
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = [ "" ];
};
pulseaudio = {
format = "{volume}% {icon} {format_source}";
2023-02-25 16:30:02 +01:00
format-bluetooth = "{volume}% {icon} {format_source} ";
format-bluetooth-muted = " {icon} {format_source}";
2023-05-18 23:17:26 +02:00
format-muted = "󰝟 {format_source}";
2023-02-25 16:30:02 +01:00
format-source = " {volume}% ";
format-source-muted = " ";
2023-01-20 21:43:16 +01:00
format-icons = {
headphone = "";
2023-05-18 23:17:26 +02:00
headset = "󰋎";
default = [ "󰕿" "󰖀" "󰕾" ];
2023-01-20 21:43:16 +01:00
};
on-click = "pavucontrol";
};
battery = {
states = {
warning = 30;
critical = 15;
};
2023-02-25 16:30:02 +01:00
format = "{capacity}% {icon} ";
2023-05-18 23:17:26 +02:00
format-charging = "{capacity}% 󱊦";
2023-01-20 21:43:16 +01:00
format-plugged = "{capacity}% ";
format-icons = [ "" "" "" "" "" ];
};
tray = {
spacing = 10;
};
};
};
};
xdg.configFile."waybar/style.css".text = ''
* {
2023-02-25 16:30:02 +01:00
font-family: Roboto, Helvetica, Arial, sans-serif, Iosevka Nerd Font;
2023-01-20 21:43:16 +01:00
font-size: 13px;
}
window#waybar {
background-color: transparent;
color: #${config.colorScheme.colors.base05};
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
background-color: transparent;
}
#workspaces button {
padding: 0 5px;
background-color: transparent;
color: #${config.colorScheme.colors.base05};
}
#workspaces button.active {
background-color: #${config.colorScheme.colors.base04};
box-shadow: inset 0 -3px #${config.colorScheme.colors.base05};
}
#workspaces button.urgent {
background-color: #eb4d4b;
}
2023-06-03 21:42:12 +02:00
#custom-spotifytitle,
2023-01-20 21:43:16 +01:00
#clock,
#battery,
#cpu,
#memory,
#temperature,
#network,
#pulseaudio,
2023-05-18 23:17:26 +02:00
#window,
2023-01-20 21:43:16 +01:00
#tray{
border-radius: 30px;
padding: 0 10px;
color: #${config.colorScheme.colors.base05};
}
#window,
#workspaces {
margin: 0 4px;
}
2023-05-18 23:17:26 +02:00
#window {
background-color: #${config.colorScheme.colors.base00};
}
2023-01-20 21:43:16 +01:00
#clock {
background-color: #${config.colorScheme.colors.base00};
}
2023-06-03 21:42:12 +02:00
#custom-spotifytitle {
background: #1db954;
color: #191414;
opacity: 1;
transition-property: opacity;
transition-duration: 0.25s;
}
#custom-spotifytitle.Paused,
#custom-spotifytitle.Inactive {
opacity: 0.5;
}
2023-01-20 21:43:16 +01:00
#battery {
background-color: #${config.colorScheme.colors.base02};
color: #${config.colorScheme.colors.base05};
}
#battery.charging, #battery.plugged {
color: #${config.colorScheme.colors.base05};
background-color: #${config.colorScheme.colors.base02};
}
#battery.critical:not(.charging) {
background-color: #${config.colorScheme.colors.base08};
color: #${config.colorScheme.colors.base01};
}
#cpu {
background-color: #${config.colorScheme.colors.base06};
color: #${config.colorScheme.colors.base01};
}
#network {
background-color: #${config.colorScheme.colors.base07};
color: #${config.colorScheme.colors.base01};
}
#network.disconnected {
background-color: #${config.colorScheme.colors.base08};
}
#pulseaudio {
background-color: #${config.colorScheme.colors.base03};
color: #${config.colorScheme.colors.base05};
}
#temperature {
background-color: #${config.colorScheme.colors.base05};
color: #${config.colorScheme.colors.base01};
}
#temperature.critical {
background-color: #${config.colorScheme.colors.base08};
color: #${config.colorScheme.colors.base01};
}
#tray {
background-color: #${config.colorScheme.colors.base01};
color: #${config.colorScheme.colors.base05};
}
'';
}