nix-dotfiles/programs/waybar.nix
vorboyvo 4fd19a9ba2 Refactored packages slightly to add let-ins instead of clogging up the space
there.
Also moved around some categories.
Installed texlab as an LSP for LaTeX.
Installed Haskell and tools.
Installed fonts rubik and archivo, the latter creating a flake and derivation
for it.
Added a desktop entry for kakoune.
Added a GeoGuessr Join search tool for Firefox.
Changed background to kuwait boat image; kept bord around.
Added dunst notifications toggle key but I don't think it works yet.
Disabled scroll to change volume in waybar volume module.
2024-03-19 23:07:41 -04:00

126 lines
3.4 KiB
Nix

{ scripts, config, lib, pkgs, terminal, ... } :
let
terminalExec = "${pkgs.lib.getExe terminal} -e";
in
{
enable = true;
settings = [{
modules-left = [ "sway/workspaces" ];
modules-right = [ "pulseaudio" "bluetooth" "network" "cpu" "memory" "disk" "battery" "tray" "clock" ];
"sway/workspaces" = {
enable-bar-scroll = true;
disable-scroll-wraparound = true;
smooth-scrolling-threshold = 2.0;
};
pulseaudio = {
format = "{volume}% {icon} {format_source}";
format-bluetooth = "{volume}% {icon} {format_source}";
format-muted = "{volume}% {format_source}";
format-source = "{volume}% ";
format-source-muted = "{volume}% ";
format-icons = [ "" "" ];
on-click = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
on-click-right = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle";
on-click-middle = "exec pavucontrol";
on-scroll-up = "";
on-scroll-down = "";
};
network = {
format-wifi = "{essid} ({signalStrength}%) ";
format-ethernet = "{ipaddr}/{cidr} ";
tooltip-format = "{ifname} via {gwaddr} ";
format-linked = "{ifname} (No IP) ";
format-disconnected = "Disconnected ";
format-alt = "{ifname}: {ipaddr}/{cidr}";
on-click-right = "exec ${terminalExec} nmtui";
};
bluetooth = {
format = " {status}";
format-disabled = ""; # hide module
format-connected = " {num_connections}";
tooltip-format = "{controller_alias}\t{controller_address}";
tooltip-format-connected = "{controller_alias}\t{controller_address}\n\n{device_enumerate}";
tooltip-format-enumerate-connected = "{device_alias}\t{device_address}";
on-click = "exec blueman-manager";
on-click-right = "exec bluetoothctl disconnect";
};
cpu = {
format = "{usage}% ";
};
memory = {
format = "{used:0.1f}GB/{total:0.1f}GB ";
};
disk = {
format = "{used} ";
path = "/";
};
battery = {
states = {
good = 95;
warning = 20;
critical = 10;
};
format = "{capacity}% {icon}";
format-charging = "{capacity}% ";
format-plugged = "{capacity}% ";
format-alt = "{time} {icon}";
format-icons = [ "" "" "" "" "" ];
};
tray = {
icon-size = 20;
spacing = 5;
};
clock = {
interval = 1;
format = "{:%H:%M:%S %a %F}";
tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
};
}];
style = ''
* {
font-family: FontAwesome, Red Hat Display, sans-serif;
font-size: 12pt;
min-height: 20pt;
}
'' +
''
window#waybar {
background: rgba(34, 34, 34, 1);
color: white;
}
'' +
''
#workspaces button {
padding: 0 3px;
background: rgba(34, 34, 34, 1);
border-style: hidden;
border-radius: 0;
color: white;
}
'' +
''
#workspaces button.focused {
background: rgba(40, 85, 119, 1);
}
.modules-right label,
.modules-right box {
border-left: 1px solid #d3d3d3;
padding-left: 5px;
padding-right: 5px;
}
'' +
''
#battery.warning:not(.charging) {
background: rgba(140, 0, 0, 1);
}
#battery.critical:not(.charging) {
background: #ffffff;
color: black;
}
'' +
"";
}