nix/home-manager/common/desktops/hyprland/components/waybar.nix

263 lines
8 KiB
Nix
Raw Normal View History

2024-02-17 14:38:35 +01:00
{ config, ... }: {
2024-01-05 08:13:22 +01:00
imports = [ ../assets/waybar/scripts.nix ];
2024-01-03 14:25:06 +01:00
2024-01-04 06:39:52 +01:00
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
modules-left = [
"custom/wlogout"
"idle_inhibitor"
"clock"
"mpris"
];
2024-01-04 14:22:55 +01:00
modules-center = [
2024-01-04 06:39:52 +01:00
"hyprland/workspaces"
];
modules-right = [
2024-01-07 09:57:41 +01:00
"privacy"
2024-01-07 07:21:41 +01:00
"hyprland/submap"
2024-01-04 06:39:52 +01:00
"pulseaudio"
"custom/tailscale"
"network"
"battery"
];
# Modules
2024-01-07 10:09:08 +01:00
gamemode = {
"format" = "{glyph}";
"format-alt" = "{glyph} {count}";
"glyph" = "";
"hide-not-running" = true;
"use-icon" = true;
"icon-name" = "input-gaming-symbolic";
"icon-spacing" = 4;
"icon-size" = 20;
"tooltip" = true;
"tooltip-format" = "Games running: {count}";
2024-01-07 10:10:25 +01:00
};
2024-01-04 06:39:52 +01:00
"custom/wlogout" = {
2024-08-18 07:06:00 +02:00
format = " ";
2024-01-04 06:39:52 +01:00
on-click = "wlogout";
};
"custom/tailscale" = {
2024-01-06 12:33:33 +01:00
format = "{icon}";
2024-01-04 06:39:52 +01:00
exec = "$HOME/.config/waybar/scripts/tailscale.sh";
exec-if = "pgrep tailscaled";
return-type = "json";
interval = 5;
format-icons = {
2024-08-18 07:06:00 +02:00
Running = " 󰌆 ";
Stopped = " 󰌊";
2024-01-04 06:39:52 +01:00
};
};
idle_inhibitor = {
2024-01-06 12:30:45 +01:00
format = "{icon}";
2024-01-04 06:39:52 +01:00
format-icons = {
2024-08-18 07:06:00 +02:00
activated = " ";
deactivated = " ";
2024-01-04 06:39:52 +01:00
};
};
mpris = {
format = "{player_icon} {dynamic}";
format-paused = ''{status_icon} <i>{dynamic}</i>'';
2024-01-07 07:21:41 +01:00
player-icons = { default = " "; };
2024-01-04 09:11:33 +01:00
status-icons = { paused = ""; };
2024-01-04 06:39:52 +01:00
max-length = 30;
};
"hyprland/workspaces" = {
on-click = "activate";
};
clock = {
2024-08-18 07:06:00 +02:00
format = "󰥔 {:%H:%M (%Z)}";
format-alt = "󰃭 {:%A, %d %b, %Y (%Z)}";
tooltip-format = "{tz_list}";
timezones = [
"Asia/Tokyo"
"Europe/Warsaw"
"America/Los_Angeles"
"America/Chicago"
"America/New_York"
];
2024-01-04 06:39:52 +01:00
calendar = {
mode = "month";
mode-mon-col = 3;
weeks-pos = "left";
on-scroll = 1;
format = {
months = "<b>{}</b>";
days = "<b>{}</b>";
weeks = "<b>W{}</b>";
weekdays = "<b>{}</b>";
today = "<b><u>{}</u></b>";
};
};
actions = {
on-click-right = "kitty -e calcurse";
on-click-middle = "mode";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
pulseaudio = {
scroll-step = 1;
2024-02-08 13:22:37 +01:00
format = "{icon}{format_source}";
2024-01-04 06:39:52 +01:00
format-bluetooth = "{volume}% {icon} {format_source}";
format-bluetooth-muted = " ";
format-muted = "󰝟 {format_source}";
2024-01-07 10:52:47 +01:00
format-source = " ";
2024-08-18 07:06:00 +02:00
format-source-muted = " ";
2024-01-04 06:39:52 +01:00
format-icons = {
headphone = " ";
headset = " ";
2024-01-07 04:05:18 +01:00
default = ["󰕿 " "󰖀 " "󰕾 "];
2024-01-04 06:39:52 +01:00
};
tooltip = false;
on-click = "kitty -e pulsemixer";
};
network = {
format = "{ifname}";
2024-08-18 07:06:00 +02:00
format-wifi = " ";
2024-01-07 04:05:18 +01:00
format-ethernet = " ";
2024-01-04 06:39:52 +01:00
format-disconnected = ""; # Hides the module
2024-08-18 07:06:00 +02:00
tooltip-format = "{ifname} via {gwaddr} ";
tooltip-format-wifi = "{essid} ({signalStrength}%) ";
2024-01-07 04:05:18 +01:00
tooltip-format-ethernet = "{ifname} \n{ipaddr}";
2024-01-04 06:39:52 +01:00
tooltip-format-disconnected = "Disconnected";
max-length = 50;
on-click = "kitty --class=nmtui -e nmtui";
};
battery = {
tooltip = true;
tooltip-format = "{time}";
states = {
warning = 35;
critical = 20;
};
2024-08-18 07:06:00 +02:00
format = "{icon} {capacity}%";
2024-02-18 03:26:01 +01:00
format-charging = "󰂄 {capacity}%";
2024-08-18 07:06:00 +02:00
format-plugged = " {capacity}%";
format-icons = [ " " " " " " " " " " ];
2024-01-04 06:39:52 +01:00
};
};
2024-01-03 14:25:06 +01:00
};
2024-01-04 09:37:55 +01:00
style = ''
* {
border: none;
border-radius: 0;
2024-01-07 07:21:41 +01:00
2024-01-04 09:37:55 +01:00
}
2024-01-03 14:25:06 +01:00
2024-01-04 09:37:55 +01:00
#waybar {
padding: 15px;
}
#workspaces button.visible,
#workspaces button {
2024-08-18 07:06:00 +02:00
font-size: 12px;
2024-01-04 09:37:55 +01:00
border-radius: 50px;
padding: 0px 5px;
margin: 5px;
}
2024-01-03 14:25:06 +01:00
#workspaces button.active {
2024-01-06 12:57:01 +01:00
background-color: #${config.lib.stylix.colors.base04};
color: #${config.lib.stylix.colors.base00};
2024-01-06 12:41:43 +01:00
padding: 0px 15px;
2024-01-03 14:25:06 +01:00
}
#workspaces button:hover,
#workspaces button.focused:hover,
#workspaces button.visible:hover {
2024-08-18 07:06:00 +02:00
background-color: #${config.lib.stylix.colors.base05};
2024-01-06 12:57:01 +01:00
color: #${config.lib.stylix.colors.base00};
2024-01-03 14:25:06 +01:00
}
#workspaces button.urgent {
2024-01-06 12:57:01 +01:00
background-color: #${config.lib.stylix.colors.base09};
color: #${config.lib.stylix.colors.base00};
2024-01-03 14:25:06 +01:00
}
/*
* General background
*/
2024-01-07 10:09:08 +01:00
#gamemode,
2024-01-07 09:59:47 +01:00
#privacy,
2024-01-03 14:25:06 +01:00
#network,
#mpris,
#memory,
#backlight,
#cpu,
#pulseaudio,
#temperature,
#battery,
#tray,
#submap,
#clock,
#idle_inhibitor,
#custom-tailscale,
#custom-wlogout,
#window {
font-size: 16px;
2024-08-18 07:06:00 +02:00
padding: 0px 5px;
2024-01-03 14:25:06 +01:00
margin: 5px;
2024-01-04 14:40:07 +01:00
border-radius: 3px;
2024-01-04 14:26:12 +01:00
font-weight: normal;
2024-08-18 07:06:00 +02:00
background-color: #${config.lib.stylix.colors.base02};
2024-01-03 14:25:06 +01:00
}
/*
* General background
*/
2024-01-07 09:59:47 +01:00
#privacy #button:hover,
2024-08-18 07:06:00 +02:00
#network #button:hover,
#mpris #button:hover,
#memory #button:hover,
#backlight #button:hover,
#cpu #button:hover,
#pulseaudio #button:hover,
#temperature #button:hover,
#battery #button:hover,
#tray #button:hover,
#submap #button:hover,
#clock #button:hover,
#idle_inhibitor #button:hover,
#custom-tailscale #button:hover,
#custom-wlogout #button:hover,
#window #button:hover{
background-color: #${config.lib.stylix.colors.base01};
2024-01-03 14:25:06 +01:00
}
/*
* Warning plugins state
*/
#battery.warning {
2024-01-06 12:52:28 +01:00
background-color: #${config.lib.stylix.colors.base0A};
2024-01-06 12:54:02 +01:00
color: #${config.lib.stylix.colors.base00};
2024-01-03 14:25:06 +01:00
}
/*
* Critical plugins state
*/
#idle_inhibitor.activated,
#battery.critical,
#custom-tailscale.Stopped,
#network.disconnected {
2024-01-06 12:52:28 +01:00
background-color: #${config.lib.stylix.colors.base08};
2024-01-06 12:54:02 +01:00
color: #${config.lib.stylix.colors.base00};
2024-01-03 14:25:06 +01:00
}
#battery.charging {
2024-01-06 12:52:28 +01:00
background-color: #${config.lib.stylix.colors.base0C};
2024-01-06 12:54:02 +01:00
color: #${config.lib.stylix.colors.base00};
2024-01-03 14:25:06 +01:00
}
2024-01-06 12:47:07 +01:00
#battery.plugged {}
#pulseaudio.bluetooth {}
2024-01-03 14:25:06 +01:00
tooltip {
font-size: 14px;
}
2024-01-04 09:37:55 +01:00
'';
};
2024-01-03 14:25:06 +01:00
}