{ pkgs, config, lib, ... }:
let
cfg = config.lily.waybar;
in
{
options.lily.waybar.enable = lib.mkEnableOption "activate waybar";
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
pavucontrol
networkmanagerapplet
blueman
];
programs.waybar = {
enable = true;
style = ./style.css;
settings = {
mainBar = {
layer = "top";
position = "top";
mode = "dock";
height = 40;
tray.icon-size = 15;
modules-left = [
"custom/icon"
"custom/separator"
"cpu"
"memory"
"temperature"
"battery"
"custom/separator"
"custom/separator"
"custom/screenshot"
"tray"
"hyprland/workspaces"
];
modules-center = [ "hyprland/window" ];
modules-right = [
"mpris"
"pulseaudio"
"network"
"bluetooth"
"custom/wallchange"
"custom/themechange"
"clock"
];
mpris = {
format = "{player_icon}{status_icon} [{position}/{length}] {title} - {artist}";
tooltip-format = "{player_icon}{status_icon} [{position}/{length}] {title} - {artist}";
title-len = 20;
artist-len = 10;
interval = 1;
player-icons = {
default = "";
mpv = "🎵 ";
spotify = " ";
};
status-icons = {
playing = "▶";
stopped = "";
paused = "";
};
on-click-middle = "playerctld shift";
};
cpu = {
interval = 10;
format = " {usage}";
max-length = 10;
};
memory = {
interval = 30;
format = " {used:0.1f}G";
max-length = 10;
};
temperatures = {
thermal-zone = 0;
critical-threshold = 90;
format-critical = " {temperatureC}°C";
format = " {temperatureC}°C";
};
battery = {
interval = 30;
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = " {icon} {capacity}%";
format-icons = [ " " " " " " " " ];
max-length = 25;
};
pulseaudio = {
format = "{icon} {volume}";
format-bluetooth = " ";
format-bluetooth-muted = " ";
format-muted = "";
format-icons = {
default = [ "" "" "" ];
};
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
};
network = {
format-wifi = " {essid}";
on-click = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
format-ethernet = " wired";
format-disconnected = "";
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
tooltip-format-ethernet = "{ifname} ";
tooltip-format-disconnected = "Disconnected";
};
bluetooth = {
tooltip = true;
on-click = "${pkgs.blueman}/bin/blueman-manager";
};
clock = {
format = " {:%d.%m.%y %H:%M}";
};
"custom/icon" = {
format = " ";
# on-click = "${config.lily.wlogout.logoutlaunch}/bin/logoutlaunch";
};
"custom/screenshot" = {
format = " ";
on-click = "GRIM_DEFAULT_DIR=${config.xdg.configHome}/../Pictures/Screenshots ${pkgs.grim}/bin/grim";
};
"custom/separator" = {
format = " ";
};
# "custom/wallchange" = {
# format = " {}";
# tooltip = true;
# exec = "echo ; echo switch wallpaper";
# on-click = "${inputs.wall-utils.packages.${pkgs.system}.wall-utils}/bin/wall-utils next";
# on-click-right = "${inputs.wall-utils.packages.${pkgs.system}.wall-utils}/bin/wall-utils previous";
# on-click-middle = "${inputs.wall-utils.packages.${pkgs.system}.wall-utils}/bin/wall-utils select";
# # interval = 3600; # once every day
# };
"hyprland/workspaces" = {
format = "{icon}"; # lavender
tooltip = false;
all-outputs = false;
current-only = true;
sort-by-number = true;
persistent-workspaces = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"10" = "";
};
format-icons = {
"1" = "";
"2" = "";
"3" = "";
"4" = "";
"5" = "";
"6" = "";
"7" = "";
"8" = "";
"9" = "";
"10" = ""; # sapphire
urgent = ""; # sapphire
active = ""; # blue
default = "";
};
};
"hyprland/window" = {
format = "{}";
rewrite = {
"" = "There is no place like ~";
};
max-length = 200;
seperate-outputs = true;
};
};
};
};
home.file.".config/waybar/themes/theme.css" = { source = ./themes/Catppuccin-Mocha.css; };
};
}