From 4a73b3a5ae44dd3017dbc359bc4e22a4bd27e9af Mon Sep 17 00:00:00 2001 From: John Ogle Date: Sat, 15 Nov 2025 12:40:53 -0800 Subject: [PATCH] [i3+sway] Customize waybar --- home/modules/i3+sway/default.nix | 115 +++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/home/modules/i3+sway/default.nix b/home/modules/i3+sway/default.nix index 00bf4a7..fa12dbb 100644 --- a/home/modules/i3+sway/default.nix +++ b/home/modules/i3+sway/default.nix @@ -183,6 +183,121 @@ in { programs.waybar = { enable = true; systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "bottom"; + height = 30; + spacing = 4; + + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-center = [ ]; + modules-right = [ "disk" "cpu" "memory" "pulseaudio" "backlight" "network" "battery" "tray" "clock" ]; + + "sway/workspaces" = { + disable-scroll = true; + all-outputs = true; + }; + + "clock" = { + format = "{:%Y-%m-%d %H:%M}"; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + + "disk" = { + interval = 30; + format = "💾 {percentage_used}%"; + path = "/"; + tooltip-format = "Used: {used} / {total} ({percentage_used}%)\nFree: {free} ({percentage_free}%)"; + }; + + "cpu" = { + format = "🧠 {usage}%"; + tooltip = false; + }; + + "memory" = { + format = "🐏 {percentage}%"; + tooltip-format = "RAM: {used:0.1f}G / {total:0.1f}G"; + }; + + "pulseaudio" = { + format = "{icon} {volume}%"; + format-muted = "🔇"; + format-icons = { + headphone = "🎧"; + default = [ "🔈" "🔉" "🔊" ]; + }; + on-click = "pavucontrol"; + }; + + "backlight" = { + format = "â˜€ī¸ {percent}%"; + tooltip = false; + }; + + "network" = { + format-wifi = "đŸ“ļ {essid} ({signalStrength}%)"; + format-ethernet = "🔌 {ipaddr}"; + format-disconnected = "❌"; + tooltip-format = "{ifname}: {ipaddr}/{cidr}"; + }; + + "battery" = { + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = "⚡ {capacity}%"; + format-icons = [ "đŸĒĢ" "🔋" "🔋" "🔋" "🔋" ]; + }; + + "tray" = { + spacing = 10; + }; + }; + }; + style = '' + * { + padding: 0 4px; + font-family: "Fira Code", monospace; + font-size: 13px; + } + + #workspaces button { + padding: 0 8px; + background-color: transparent; + color: #ffffff; + border: none; + } + + #workspaces button.focused { + background-color: #285577; + font-weight: bold; + } + + #workspaces button.visible { + background-color: #5f676a; + } + + #workspaces button.urgent { + background-color: #900000; + } + ''; }; programs.rofi = {