grimm-nixos-laptop/sway/bar/default.nix
2024-05-05 18:23:46 +02:00

128 lines
3.9 KiB
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) getExe;
in
{
grimmShared.sway.bar = {
enable = true;
config = with pkgs; {
backlight = {
format = "{percent}%";
format-icons = [ "" "" "" "" "" "" "" "" "" ];
};
battery = {
format = "{capacity}% {icon}";
format-alt = "{time} {icon}";
format-charging = "{capacity}% ";
format-icons = [ "" "" "" "" "" ];
format-plugged = "{capacity}% ";
on-click = "${getExe rmenu} -r powermenu --single-click true";
states = { critical = 15; warning = 30; };
};
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}";
format-icons = { activated = ""; deactivated = ""; };
};
keyboard-state = {
capslock = true;
format = "{name} {icon}";
format-icons = { locked = ""; unlocked = ""; };
numlock = true;
};
memory = { format = "{}% "; };
modules-center = [
# "wlr/taskbar"
];
modules-left = [ "sway/workspaces" "sway/mode" "sway/scratchpad" ];
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 = "";
default = [ "" "" "" ];
hands-free = "";
headphone = "";
headset = "";
phone = "";
portable = "";
muted = "🔇";
};
format-muted = "{icon} {format_source}";
format-source = "{volume}% ";
format-source-muted = "";
on-click = "${getExe pwvucontrol}";
};
spacing = 4;
"sway/mode" = { format = "<span style=\"italic\">{}</span>"; };
"sway/scratchpad" = {
format = "{icon} {count}";
format-icons = [ "" "" ];
show-empty = false;
tooltip = true;
tooltip-format = "{app}: {title}";
};
temperature = {
critical-threshold = 80;
format = "{temperatureC}°C {icon}";
format-icons = [ "" "" "" ];
};
tray = { spacing = 10; };
"wlr/taskbar" = {
format = "{icon}";
icon-size = 14;
ignore-list = [ ];
on-click = "activate";
on-click-middle = "close";
rewrite = { "Firefox Web Browser" = "Firefox"; };
tooltip-format = "{title}";
};
};
style = ./style.css;
};
}