nixfiles/modules/graphical/waybar-hyprland.nix

130 lines
4.2 KiB
Nix
Raw Permalink Normal View History

2024-09-10 12:02:18 +02:00
{ config, lib, pkgs, ... }: {
config.home-manager.users.emily = lib.mkIf config.kyouma.graphical.enable {
2024-06-21 00:35:34 +02:00
programs.waybar = {
enable = true;
style = ./files/waybar-style.css;
systemd = {
enable = true;
target = "hyprland-session.target";
};
settings = {
hyprbar = {
layer = "top";
position = "top";
#output = "eDP-1";
margin = "0 0 0 0";
modules-left = [ "hyprland/workspaces" "custom/playerctl" "tray" ];
modules-center = [ "clock" ];
modules-right = [ "backlight" "pulseaudio" "temperature" "cpu" "memory" "battery" "network" ];
"hyprland/workspaces" = {
format = "{icon}";
sort-by-number = true;
active-only = false;
on-click = "activate";
format-icons = {
"1" = "1";
"2" = "2";
"3" = "3";
"4" = "4";
"5" = "5";
"6" = "6";
"7" = "7";
"8" = "8";
"9" = "9";
"10" = "0";
urgent = "";
focused = "";
default = "";
};
};
idle_inhibitor = {
format = "{icon}";
format-icons = {
activated = "";
deactivated = "";
};
};
tray = {
icon-size = 18;
spacing = 8;
};
clock = {
#tooltip-format = "{:%A %d %B | %H:%M}";
format = " {:%Y-%m-%d %H:%M:%OS}";
format-alt = " {:%Y %b %d %a %H:%M:%OS}";
interval = 1;
};
cpu = {
format = " {usage:02}";
interval = 2;
on-click = "${pkgs.kitty}/bin/kitty -e ${pkgs.htop}/bin/htop";
};
memory = {
format = " {used:0.2f}";
on-click = "${pkgs.kitty}/bin/kitty -e ${pkgs.htop}/bin/htop";
};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon1/temp1_input";
critical-threshold = 80;
format = " {temperatureC}°C";
};
backlight = {
format = "{icon} {percent: >3}%";
format-icons = ["" ""];
on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl -c backlight set 1%-";
on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl -c backlight set +1%";
};
battery = {
states = {
good = 90;
warning = 30;
critical = 15;
};
format = "";
format-discharging = "{icon} {capacity: >3}% {power:0.1f}W";
format-charging = " {capacity: >3}% {power:0.1f}W";
interval = 3;
format-icons = ["" "" "" "" ""];
};
network = {
format = " Disabled";
format-wifi = " {essid}";
format-ethernet = " Wired";
format-disconnected = " Disconnected";
on-click = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
};
pulseaudio = {
scroll-step = 5;
format = "{icon} {volume: >3}%";
format-bluetooth = "{icon} {volume: >3}%";
format-muted = " muted";
format-icons = {
headphones = "";
handsfree = "";
headset = "";
phone = "";
portable = "";
car = "";
default = ["" ""];
};
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
};
"custom/playerctl" = {
interval = 1;
exec = "~/.local/bin/hypr/playerctl.sh";
on-click-middle = "${pkgs.playerctl}/bin/playerctl play-pause";
on-click-right = "${pkgs.playerctl}/bin/playerctl next";
on-click = "${pkgs.playerctl}/bin/playerctl previous";
escape = true;
};
};
};
};
systemd.user.targets.tray.Unit = {
BindsTo = "waybar.service";
After = "waybar.service";
};
};
}