grimm-nixos-laptop/sway/bar/default.nix

181 lines
4.3 KiB
Nix
Raw Normal View History

2024-05-07 23:31:41 +02:00
{
config,
lib,
pkgs,
...
}:
2024-05-05 16:25:16 +02:00
let
inherit (lib) getExe;
in
{
grimmShared.sway.bar = {
enable = true;
2024-05-05 18:23:46 +02:00
config = with pkgs; {
backlight = {
format = "{percent}%";
2024-05-07 23:31:41 +02:00
format-icons = [
""
""
""
""
""
""
""
""
""
];
2024-05-05 18:23:46 +02:00
};
battery = {
format = "{capacity}% {icon}";
format-alt = "{time} {icon}";
format-charging = "{capacity}% ";
2024-05-07 23:31:41 +02:00
format-icons = [
""
""
""
""
""
];
2024-05-05 18:23:46 +02:00
format-plugged = "{capacity}% ";
on-click = "${getExe rmenu} -r powermenu --single-click true";
2024-05-07 23:31:41 +02:00
states = {
critical = 15;
warning = 30;
};
2024-05-05 18:23:46 +02:00
};
clock = {
format-alt = "{:%d.%m.%Y}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
cpu = {
format = "{usage}% ";
tooltip = false;
on-click = "${getExe xdg-terminal-exec} ${getExe btop}";
};
"custom/media" = {
escape = true;
exec = "${getExe waybar-mpris} --position --autofocus --pause --play --order SYMBOL:TITLE:ARTIST:ALBUM:POSITION ";
max-length = 40;
on-click = "${getExe waybar-mpris} --send toggle";
on-scroll-down = "${getExe waybar-mpris} --send prev";
on-scroll-up = "${getExe waybar-mpris} --send next";
return-type = "json";
};
margin-right = 4;
height = 30;
idle_inhibitor = {
format = "{icon}";
2024-05-07 23:31:41 +02:00
format-icons = {
activated = "";
deactivated = "";
};
2024-05-05 18:23:46 +02:00
};
keyboard-state = {
capslock = true;
format = "{name} {icon}";
2024-05-07 23:31:41 +02:00
format-icons = {
locked = "";
unlocked = "";
};
2024-05-05 18:23:46 +02:00
numlock = true;
};
2024-05-07 23:31:41 +02:00
memory = {
format = "{}% ";
};
2024-05-05 18:23:46 +02:00
modules-center = [
# "wlr/taskbar"
];
2024-05-07 23:31:41 +02:00
modules-left = [
"sway/workspaces"
"sway/mode"
"sway/scratchpad"
];
2024-05-05 18:23:46 +02:00
modules-right = [
"custom/media"
"idle_inhibitor"
"pulseaudio"
"network"
"cpu"
"memory"
"temperature"
"backlight"
"keyboard-state"
"battery"
"clock"
"tray"
];
network = {
format-alt = "{ifname}: {ipaddr}/{cidr}";
format-disconnected = "Disconnected ";
format-ethernet = "{ipaddr}/{cidr} ";
format-linked = "{ifname} (No IP) ";
format-wifi = "{essid} ({signalStrength}%) ";
on-click-right = "nm-connection-editor";
tooltip-format = "{ifname} via {gwaddr} ";
};
position = "top";
pulseaudio = {
format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-bluetooth-muted = "{icon} {format_source}";
format-icons = {
car = "";
2024-05-07 23:31:41 +02:00
default = [
""
""
""
];
2024-05-05 18:23:46 +02:00
hands-free = "";
headphone = "";
headset = "";
phone = "";
portable = "";
muted = "🔇";
};
format-muted = "{icon} {format_source}";
format-source = "{volume}% ";
format-source-muted = "";
on-click = "${getExe pwvucontrol}";
};
spacing = 4;
2024-05-07 23:31:41 +02:00
"sway/mode" = {
format = "<span style=\"italic\">{}</span>";
};
2024-05-05 18:23:46 +02:00
"sway/scratchpad" = {
format = "{icon} {count}";
2024-05-07 23:31:41 +02:00
format-icons = [
""
""
];
2024-05-05 18:23:46 +02:00
show-empty = false;
tooltip = true;
tooltip-format = "{app}: {title}";
};
temperature = {
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
2024-05-07 23:31:41 +02:00
format-icons = [
""
""
""
];
};
tray = {
spacing = 10;
2024-05-05 18:23:46 +02:00
};
"wlr/taskbar" = {
format = "{icon}";
icon-size = 14;
ignore-list = [ ];
on-click = "activate";
on-click-middle = "close";
2024-05-07 23:31:41 +02:00
rewrite = {
"Firefox Web Browser" = "Firefox";
};
2024-05-05 18:23:46 +02:00
tooltip-format = "{title}";
};
};
2024-05-05 16:25:16 +02:00
style = ./style.css;
};
}