232 lines
6.2 KiB
Nix
Raw Normal View History

2024-06-18 04:49:58 +03:00
{ config, pkgs, lib, ... }:
let
thm = config.lib.base16.theme;
in
2022-11-21 02:53:20 +03:00
with config.deviceSpecific; {
2022-12-10 22:34:39 +03:00
home-manager.users.${config.mainuser}.programs.waybar = {
2022-08-18 18:00:14 +03:00
enable = true;
2024-06-18 04:49:58 +03:00
# style = builtins.readFile ./style.css;
2024-02-08 23:32:56 +03:00
systemd.enable = true;
2024-12-28 11:43:02 +03:00
systemd.target = "graphical-session.target";
2022-08-18 18:00:14 +03:00
settings = {
mainBar = {
layer = "top";
position = "top";
2024-06-18 04:49:58 +03:00
# margin = "8 8 0 8";
modules-left = [
"hyprland/workspaces"
# "wireplumber"
] ++ lib.optionals isLaptop [
2022-09-23 21:26:59 +03:00
"battery"
2024-06-18 04:49:58 +03:00
"backlight"
];
modules-center = [ "hyprland/window" ];
modules-right = [
2022-08-18 18:00:14 +03:00
"tray"
2022-11-21 02:53:20 +03:00
"disk"
2024-06-18 04:49:58 +03:00
"cpu"
# "temperature"
"memory"
2022-11-21 02:53:20 +03:00
"clock"
2022-08-18 18:00:14 +03:00
];
2024-06-18 04:49:58 +03:00
backlight = {
device = "intel_backlight";
format = "{percent}% {icon}";
format-icons = [ "" "" "" "" "" "" "" ];
# min-length = 7;
};
battery = {
interval = 60;
states = {
warning = 30;
critical = 15;
};
format = "{icon} {capacity}%";
format-charging = "<span color=\"#e0af68\">󱐌</span> {capacity}%";
format-icons = [
"<span color=\"#f7768e\"> </span>"
"<span color=\"#f7768e\"> </span>"
"<span color=\"#7aa2f7\"> </span>"
"<span color=\"#7aa2f7\"> </span>"
"<span color=\"#7aa2f7\"> </span>"
];
on-update = "$HOME/.config/waybar/scripts/check_battery.sh";
};
clock = {
format = "{:%a, %d %b, %H:%M}";
tooltip-format = "<tt>{calendar}</tt>";
calendar = {
mode = "month";
2024-06-30 13:52:04 +03:00
mode-mon-col = 3;
2024-06-18 04:49:58 +03:00
weeks-pos = "right";
on-scroll = 1;
format = {
months = "<span color='#c0caf5'><b>{}</b></span>";
days = "<span color='#c0caf5'><b>{}</b></span>";
weeks = "<span color='#7dcfff'><b>W{}</b></span>";
weekdays = "<span color='#ff9e64'><b>{}</b></span>";
today = "<span color='#f7768e'><b><u>{}</u></b></span>";
};
};
2024-06-30 13:52:04 +03:00
actions = {
on-click-right = "mode";
on-click-middle = "shift_reset";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
2024-06-18 04:49:58 +03:00
};
2022-08-18 18:00:14 +03:00
cpu = {
interval = 4;
2024-06-19 12:50:13 +03:00
format = "<span color=\"#7aa2f7\"></span>{usage}%";
2022-08-18 18:00:14 +03:00
};
disk = {
interval = 60;
2024-06-30 13:52:04 +03:00
format = "<span color=\"#7aa2f7\"></span>{free}";
2023-04-08 18:00:13 +03:00
path = "/home";
2022-08-18 18:00:14 +03:00
};
2024-06-18 04:49:58 +03:00
"hyprland/window" = {
max-length = 64;
2022-08-18 18:00:14 +03:00
};
2024-06-18 04:49:58 +03:00
"hyprland/workspaces" = {
2022-08-18 18:00:14 +03:00
format = "{icon}";
on-click = "activate";
2024-06-18 04:49:58 +03:00
disable-scroll = true;
2022-08-18 18:00:14 +03:00
format-icons = {
"10" = "0";
"Messengers" = "Msg";
"Music" = "Mus";
};
};
2024-06-18 04:49:58 +03:00
memory = {
format = "<span color=\"#7aa2f7\"></span>{used}GiB";
interval = 4;
};
2022-09-23 21:26:59 +03:00
temperature = {
2024-06-18 04:49:58 +03:00
# "hwmon-path" = "/sys/class/hwmon/hwmon0/temp1_input";
2022-09-23 21:26:59 +03:00
critical-threshold = 80;
2024-06-18 04:49:58 +03:00
format = "<span color=\"#7aa2f7\">\uf4f5</span>{temperatureC}°C";
format-critical = "<span color=\"#f7768e\"> </span>{temperatureC}°C";
interval = 4;
2022-09-23 21:26:59 +03:00
};
tray = {
2024-06-18 04:49:58 +03:00
icon-size = 12;
spacing = 6;
};
wireplumber = {
scroll-step = 5;
format = "<span color=\"#7aa2f7\">{icon} </span>{volume}%";
format-muted = "<span color=\"#f7768e\">\ueee8</span>Muted";
format-bluetooth = "<span color=\"#7aa2f7\">\uf282 </span>{volume}%";
on-click-right = "blueman-manager";
format-icons = [ "\uf026 " "\uf027 " "\uf028 " ];
on-click = "pavucontrol";
2022-09-23 21:26:59 +03:00
};
2022-08-18 18:00:14 +03:00
};
};
2024-06-18 04:49:58 +03:00
style = let
accent = "lavender";
in ''
@import "catppuccin.css";
* {
font-family:
"${thm.fonts.mono.family}",
feather;
font-weight: 500;
font-size: 11pt;
color: @text;
}
/* main waybar */
window#waybar {
padding: 0;
margin: 0;
/* background: rgba(26, 27, 38, 0.7); */
background: @base;
}
/* when hovering over modules */
tooltip {
background: @base;
border-radius: 5%;
}
#workspaces button {
padding: 2px;
}
/* Sets active workspace to have a solid line on the bottom */
#workspaces button.active {
border-bottom: 2px solid @${accent};
border-radius: 0;
margin-top: 2px;
transition: all 0.5s ease-in-out;
}
/* More workspace stuff for highlighting on hover */
#workspaces button.focused {
color: @subtext0;
}
#workspaces button.urgent {
color: #f7768e;
}
#workspaces button:hover {
background: @crust;
color: @text;
}
/* Sets background, padding, margins, and borders for (all) modules */
#workspaces,
#clock,
#window,
#temperature,
#disk,
#cpu,
#memory,
#network,
#wireplumber,
#tray,
#backlight,
#battery {
/* background: rgba(26, 27, 38, 0); */
background: @base;
padding: 0 10px;
border: 0;
}
#workspaces {
padding-right: 0px;
}
/* Hide window module when not focused on window or empty workspace */
window#waybar.empty #window {
padding: 0;
margin: 0;
opacity: 0;
}
/* Set up rounding to make these modules look like separate pills */
#tray {
color: @${accent};
border-radius: 12px;
margin-right: 4px;
}
#window {
border-radius: 12px;
}
/* close right side of bar */
#temperature {
border-radius: 12px 0 0 12px;
}
/* close left side of bar */
#battery {
border-radius: 0 12px 12px 0;
}
'';
2022-08-18 18:00:14 +03:00
};
}