nixos/home/waybar/default.nix

224 lines
6.8 KiB
Nix
Raw Normal View History

2024-01-30 14:21:50 +00:00
{
config,
pkgs,
...
}: {
systemd.user.targets.tray.Unit = {
Description = "Home Manager System Tray";
2024-01-30 14:21:50 +00:00
Requires = ["graphical-session-pre.target"];
};
2023-07-10 11:24:42 +01:00
programs.waybar = {
enable = true;
style = builtins.readFile (config.lib.stylix.colors {
template = ./default.mustache;
extension = ".css";
});
2023-10-13 15:00:40 +01:00
systemd = {
enable = true;
target = "hyprland-session.target";
};
settings.main = {
layer = "top";
position = "top";
# Layout
2024-01-30 14:21:50 +00:00
"modules-left" = ["hyprland/window" "mpris"];
"modules-center" = ["hyprland/workspaces"];
"modules-right" = [
2024-01-03 19:18:40 +00:00
"custom/notification"
"pulseaudio"
"network"
"bluetooth"
"clock#calendar"
"clock"
"backlight"
"battery"
"custom/weather"
"tray"
];
# Module config
"hyprland/window" = {
"format" = "{title}";
# TODO workspace rewrites
"rewrite" = {
"(.*) - GNU Emacs at (.*)" = " $1 [$2]";
"(Alacritty.*)" = " $1";
2024-02-16 11:12:00 +00:00
"(.*) - mpv" = "󰦟 $1";
"(btm)" = " Resource Usage [$1]";
"(cava)" = "󰝚 Music Visualiser [$1]";
"(.*) - Thunar" = "󰝰 $1";
"Nyxt - (.*)" = "󰀹 $1";
"(.*) Mozilla Firefox" = "󰈹 $1";
"((?:.*)WebCord.*)" = "󰙯 $1";
"(Signal.*)" = "󰭹 $1";
"(WhatsApp for Linux.*)" = "󰖣 $1";
"([Ss]team)" = "󰓓 $1";
"(Prism Launcher.*)" = "󰍳 Minecraft ($1)";
2024-02-02 11:25:49 +00:00
"Microsoft Teams(?: classic)?(?: - )?(.*)(?: \| Microsoft Teams)?" = "󰊻 $1";
};
"separate-outputs" = true;
};
"hyprland/workspaces" = {
format = "{icon}";
format-icons = {
default = "󰋙 ";
active = "󰫈 ";
urgent = "󰁡 ";
};
show-special = false;
persistent-workspaces = {
2024-01-30 14:21:50 +00:00
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
"6" = [];
};
};
mpris = {
"format" = "> {player_icon} {player}";
2024-01-17 06:18:29 +00:00
"tooltip-format" = "{player_icon} ({player}) {dynamic}";
"interval" = 1;
2024-01-30 14:21:50 +00:00
"dynamic-order" = ["album" "artist" "title" "position" "length"];
"player-icons" = {
"default" = "󰲸 ";
"emms" = " ";
2024-01-17 16:22:05 +00:00
"firefox" = "󰈹 ";
"mpv" = "󰦟 ";
};
"status-icons" = {
"playing" = "󰐊";
"paused" = "󰏤";
"stopped" = "󰓛";
};
2024-01-30 14:21:50 +00:00
"ignored-players" = [];
};
pulseaudio = {
scroll-step = 5;
2023-12-18 11:23:14 +00:00
format = "{format_source} {icon} {volume}%";
format-muted = "{format_source} 󰝟 ";
format-source = "󰍬";
format-source-muted = "󰍭";
format-icons = {
car = "󰄍";
2024-01-30 14:21:50 +00:00
default = ["󰕿" "󰖀" "󰕾"];
hands-free = "󰥰";
headset = "󰋎";
phone = "󰏲";
portable = "󰏳";
headphone = "󰋋";
};
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
on-click-right = "${pkgs.pamixer}/bin/pamixer -t";
on-scroll-up = "${pkgs.pamixer}/bin/pamixer -i 5";
on-scroll-down = "${pkgs.pamixer}/bin/pamixer -d 5";
};
disk = {
format = "󰋊 {percentage_used}%";
path = config.home.homeDirectory;
};
cpu = {
format = "󰻠 {usage}%";
tooltip = false;
};
2024-01-30 14:21:50 +00:00
memory = {format = "󰍛 {}%";};
temperature = {
critical-threshold = 80;
format = "{icon} {temperatureC}°C";
2024-01-30 14:21:50 +00:00
format-icons = ["󱃃" "󰔏" "󱃂"];
};
network = {
format-icons = ["󰤟 " "󰤢 " "󰤥 " "󰤨 "];
format-wifi = "{icon}";
format-ethernet = "󰈁 ";
tooltip-format = "{essid} ({signalStrength}%)";
format-linked = "󰈂 ";
format-disconnected = "󰈂 ";
};
bluetooth = {
format = "󰂯 ";
format-disabled = "󰂲 ";
format-off = "󰂲 ";
format-on = "󰂯 ";
format-connected = "󰂱 ";
tooltip-format = "{status} | {device_alias}";
on-click = "${pkgs.bluez}/bin/bluetoothctl power on";
on-click-right = "${pkgs.bluez}/bin/bluetoothctl power off";
};
"clock#calendar" = {
format = "{:󰃭 %Y-%m-%d}";
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";
};
};
clock = {format = "{:󰥔 %R}";};
backlight = {
format = "{icon}";
tooltip-format = "{percent}%";
format-icons = [" " " " " " " " " " " " " " " " " "];
};
battery = {
states = {
warning = 30;
critical = 20;
};
format = "{icon}";
format-charging = "󰂄 ";
format-plugged = "󰚥 ";
tooltip-format = "{capacity}% {time}";
format-icons = ["󱃍 " "󰁺 " "󰁻 " "󰁼 " "󰁽 " "󰁾 " "󰁿 " "󰂀 " "󰂁 " "󰂂 " "󰁹 "];
};
2024-01-30 14:21:50 +00:00
"custom/notification" = let
swaync = pkgs.swaynotificationcenter;
in {
2024-01-03 19:18:40 +00:00
"tooltip" = false;
2024-01-22 11:58:27 +00:00
"format" = "{icon}{}";
2024-01-03 19:18:40 +00:00
"format-icons" = {
"notification" = "󱅫 ";
"none" = "󰂚 ";
"dnd-notification" = "󰅸 ";
"dnd-none" = "󰂜 ";
"inhibited-notification" = "󰅸 ";
"inhibited-none" = "󰂜 ";
"dnd-inhibited-notification" = "󰅸 ";
"dnd-inhibited-none" = "󰂜 ";
};
"return-type" = "json";
"exec-if" = "which ${swaync}/bin/swaync-client";
"exec" = "${swaync}/bin/swaync-client -swb";
"on-click" = "${swaync}/bin/swaync-client -t -sw";
"on-click-right" = "${swaync}/bin/swaync-client -d -sw";
2024-01-03 19:18:40 +00:00
"escape" = true;
};
"custom/weather" = {
"format" = "{}°";
"tooltip" = true;
"interval" = 3600;
"exec" = "${pkgs.wttrbar}/bin/wttrbar --location Didcot --hide-conditions";
"return-type" = "json";
};
tray = {
icon-size = config.stylix.fonts.sizes.desktop;
show-passive-items = true;
spacing = 5;
};
};
2023-07-10 11:24:42 +01:00
};
}