nixos-config/users/rouven/modules/wayland/waybar.nix

214 lines
6 KiB
Nix
Raw Permalink Normal View History

2024-03-11 22:48:42 +01:00
{ config, pkgs, ... }:
2023-01-20 21:43:16 +01:00
{
2023-06-06 13:20:37 +02:00
systemd.user.services.waybar.Service.Environment = "PATH=${pkgs.swaynotificationcenter}/bin";
2023-01-20 21:43:16 +01:00
programs.waybar = {
enable = true;
2023-02-21 12:24:34 +01:00
systemd.enable = true;
2023-01-20 21:43:16 +01:00
settings = {
mainBar = {
layer = "top";
position = "top";
height = 26;
2024-02-26 19:15:36 +01:00
modules-left = [ "sway/workspaces" "river/tags" "river/window" ];
2023-09-03 22:30:56 +02:00
modules-right = [ "network" "cpu" "pulseaudio" "battery" "tray" "custom/notification" "clock" ];
2023-01-20 21:43:16 +01:00
network = {
2023-02-25 16:30:02 +01:00
format-wifi = " {essid} ({signalStrength}%)";
2023-02-25 22:28:04 +01:00
format-ethernet = "󰈀 {ipaddr}/{cidr}";
tooltip-format = "󰈀 {ifname} via {gwaddr}";
format-linked = "󰈀 {ifname} (No IP)";
2023-01-20 21:43:16 +01:00
format-disconnected = "Disconnected ";
format-alt = "{ifname}: {ipaddr}/{cidr}";
};
2023-12-17 17:22:51 +01:00
"river/tags" = {
2023-05-18 23:17:26 +02:00
format = "{icon}";
on-click = "activate";
};
2024-01-22 01:07:30 +01:00
"sway/workspaces" = {
format = "{icon}";
on-click = "activate";
};
2023-12-17 17:22:51 +01:00
"river/window" = {
2023-05-18 23:17:26 +02:00
format = " {}";
2023-06-05 19:57:19 +02:00
# separate-outputs = true;
2023-05-18 23:17:26 +02:00
};
2023-06-03 21:42:12 +02:00
2023-06-06 13:20:37 +02:00
"custom/notification" = {
tooltip = false;
format = "{icon} ";
format-icons = {
notification = "<span foreground='red'><sup></sup></span>";
none = "";
dnd-notification = "<span foreground='red'><sup></sup></span>";
dnd-none = "";
inhibited-notification = "<span foreground='red'><sup></sup></span>";
inhibited-none = "";
dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>";
dnd-inhibited-none = "";
};
return-type = "json";
# exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "swaync-client -t -sw";
on-click-right = "swaync-client -d -sw";
escape = true;
};
2023-01-20 21:43:16 +01:00
cpu = {
format = "{usage}% ";
};
temperature = {
2023-06-26 23:04:01 +02:00
hwmon-path = "/sys/devices/platform/thinkpad_hwmon/hwmon/hwmon4/temp1_input";
2023-01-20 21:43:16 +01:00
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = [ "" ];
};
pulseaudio = {
format = "{volume}% {icon} {format_source}";
2023-06-22 14:34:05 +02:00
format-bluetooth = "{volume}% {icon} {format_source} ";
format-bluetooth-muted = " {icon} {format_source}";
2023-05-18 23:17:26 +02:00
format-muted = "󰝟 {format_source}";
2023-02-25 16:30:02 +01:00
format-source = " {volume}% ";
format-source-muted = " ";
2023-01-20 21:43:16 +01:00
format-icons = {
headphone = "";
2023-05-18 23:17:26 +02:00
headset = "󰋎";
default = [ "󰕿" "󰖀" "󰕾" ];
2023-01-20 21:43:16 +01:00
};
on-click = "pavucontrol";
};
battery = {
states = {
warning = 30;
critical = 15;
};
2023-02-25 16:30:02 +01:00
format = "{capacity}% {icon} ";
2023-05-18 23:17:26 +02:00
format-charging = "{capacity}% 󱊦";
2023-01-20 21:43:16 +01:00
format-plugged = "{capacity}% ";
format-icons = [ "" "" "" "" "" ];
};
tray = {
spacing = 10;
};
};
};
};
xdg.configFile."waybar/style.css".text = ''
* {
font-size: 13px;
}
window#waybar {
background-color: transparent;
color: #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
transition-property: background-color;
transition-duration: .5s;
}
window#waybar.hidden {
background-color: transparent;
}
2024-01-22 01:07:30 +01:00
#workspaces button,
2023-12-17 17:22:51 +01:00
#tags button {
2023-01-20 21:43:16 +01:00
padding: 0 5px;
background-color: transparent;
color: #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
}
2023-06-26 23:04:01 +02:00
2024-01-22 01:07:30 +01:00
#workspaces button.focused,
2023-12-17 17:22:51 +01:00
#tags button.focused {
background-color: #${config.colorScheme.palette.base04};
box-shadow: inset 0 -3px #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
}
2023-12-17 18:00:11 +01:00
#tags button.occupied {
box-shadow: inset 0 -3px #${config.colorScheme.palette.base05};
2023-12-17 18:00:11 +01:00
}
2023-01-20 21:43:16 +01:00
2024-01-22 01:07:30 +01:00
#workspaces button.urgent,
2023-12-17 17:22:51 +01:00
#tags button.urgent {
2023-01-20 21:43:16 +01:00
background-color: #eb4d4b;
}
2023-06-06 13:20:37 +02:00
#custom-notification,
2023-01-20 21:43:16 +01:00
#clock,
#battery,
#cpu,
#memory,
#temperature,
#network,
#pulseaudio,
2023-05-18 23:17:26 +02:00
#window,
2023-01-20 21:43:16 +01:00
#tray{
border-radius: 30px;
padding: 0 10px;
color: #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
}
#window,
#workspaces {
margin: 0 4px;
}
2023-05-18 23:17:26 +02:00
#window {
background-color: #${config.colorScheme.palette.base00};
2023-05-18 23:17:26 +02:00
}
2023-01-20 21:43:16 +01:00
#clock {
background-color: #${config.colorScheme.palette.base00};
2023-01-20 21:43:16 +01:00
}
#battery {
background-color: #${config.colorScheme.palette.base02};
color: #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
}
#battery.charging, #battery.plugged {
color: #${config.colorScheme.palette.base05};
background-color: #${config.colorScheme.palette.base02};
2023-01-20 21:43:16 +01:00
}
#battery.critical:not(.charging) {
background-color: #${config.colorScheme.palette.base08};
color: #${config.colorScheme.palette.base01};
2023-01-20 21:43:16 +01:00
}
#cpu {
background-color: #${config.colorScheme.palette.base05};
color: #${config.colorScheme.palette.base01};
2023-01-20 21:43:16 +01:00
}
#network {
background-color: #${config.colorScheme.palette.base06};
color: #${config.colorScheme.palette.base01};
2023-01-20 21:43:16 +01:00
}
#network.disconnected {
background-color: #${config.colorScheme.palette.base08};
2023-01-20 21:43:16 +01:00
}
#pulseaudio {
background-color: #${config.colorScheme.palette.base03};
color: #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
}
#temperature {
background-color: #${config.colorScheme.palette.base05};
color: #${config.colorScheme.palette.base01};
2023-01-20 21:43:16 +01:00
}
#temperature.critical {
background-color: #${config.colorScheme.palette.base08};
color: #${config.colorScheme.palette.base01};
2023-01-20 21:43:16 +01:00
}
2023-06-06 13:20:37 +02:00
#custom-notification,
2023-01-20 21:43:16 +01:00
#tray {
background-color: #${config.colorScheme.palette.base01};
color: #${config.colorScheme.palette.base05};
2023-01-20 21:43:16 +01:00
}
'';
}