nixos/home/hyprland/waybar/default.nix

168 lines
4.8 KiB
Nix

{ config, lib, pkgs, ... }: {
home.packages = with pkgs; [ networkmanagerapplet bluez ];
stylix.targets.waybar.enable = false;
xdg.configFile."waybar/scheme.css".text =
with config.lib.stylix.colors.withHashtag; ''
@define-color base00 ${base00};
@define-color base01 ${base01};
@define-color base02 ${base02};
@define-color base03 ${base03};
@define-color base04 ${base04};
@define-color base05 ${base05};
@define-color base06 ${base06};
@define-color base07 ${base07};
@define-color base08 ${base08};
@define-color base09 ${base09};
@define-color base0A ${base0A};
@define-color base0B ${base0B};
@define-color base0C ${base0C};
@define-color base0D ${base0D};
@define-color base0E ${base0E};
@define-color base0F ${base0F};
* { font-family: "${config.stylix.fonts.sansSerif.name}" }
'';
systemd.user.targets.tray.Unit = {
Description = "Home Manager System Tray";
Requires = [ "graphical-session-pre.target" ];
};
programs.waybar = {
enable = true;
style = ./style.css;
systemd = {
enable = true;
target = "hyprland-session.target";
};
settings.main = {
layer = "top";
position = "top";
# Layout
"modules-left" = [ "hyprland/workspaces" ];
"modules-center" = [ "mpris" ];
"modules-right" = [
"pulseaudio"
"battery"
"disk"
"cpu"
"memory"
"temperature"
"clock"
"tray"
];
# Module config
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
"1" = "󰫃";
"2" = "󰫄";
"3" = "󰫅";
"4" = "󰫆";
"5" = "󰫇";
"6" = "󰫈";
default = "󰋙";
special = "󱗿";
urgent = "󰁡";
};
show-special = true;
};
mpris = {
"format" =
"{player_icon} <b>{title}</b> [{position}/{length}] {status_icon}";
"interval" = 1;
"player-icons" = {
"default" = "󰲸";
"mpv" = "󰤽";
"kdeconnect" = "󱀟";
"ncspot" = "󰓇";
};
"status-icons" = {
"playing" = "󰐊";
"paused" = "󰏤";
"stopped" = "󰓛";
};
"ignored-players" = [ "firefox" ];
};
pulseaudio = {
scroll-step = 5;
format = "{volume}% {icon} {format_source}";
format-muted = " 󰝟 {format_source}";
format-source = "󰍬";
format-source-muted = "󰍭";
format-icons = {
car = "󰄍";
default = [ "󰕿" "󰖀" "󰕾" ];
hands-free = "󰥰";
headset = "󰋎";
phone = "󰏲";
portable = "󰏳";
headphone = "󰋋";
};
on-click = "pavucontrol";
on-click-middle = "volumectl -m %";
on-click-right = "volumectl %";
on-scroll-up = "volumectl -u + 5";
on-scroll-down = "volumectl -u - 5";
};
backlight = {
format = "{icon}";
tooltip-format = "{percent}%";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{capacity}% {icon}";
format-charging = "󰂄";
format-plugged = "󰚥";
tooltip-format = "{time} {capacity}%";
format-icons = [ "󱃍" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
};
disk = {
format = "{percentage_used}% 󰋊";
path = config.home.homeDirectory;
};
cpu = {
format = "{usage}% 󰻠";
tooltip = false;
};
memory = { format = "{}% 󰍛"; };
temperature = {
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = [ "󱃃" "󰔏" "󱃂" ];
};
clock = {
format = "{:%a %d %b %R}";
format-alt = "{:%A %F %T}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "month";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
on-click-right = "mode";
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
actions = {
on-click-right = "mode";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
tray = {
icon-size = 16;
show-passive-items = true;
spacing = 5;
};
};
};
}