From f5717a90fb2d53cf538a0941f74633cd3bd7c250 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sun, 7 Dec 2025 19:48:29 +0200 Subject: [PATCH] feat: waybar --- modules/home/waybar.nix | 137 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 modules/home/waybar.nix diff --git a/modules/home/waybar.nix b/modules/home/waybar.nix new file mode 100644 index 0000000..816f8c6 --- /dev/null +++ b/modules/home/waybar.nix @@ -0,0 +1,137 @@ +{ + flake.modules.homeManager.waybar = { + config, + lib, + ... + }: let + cfg = config.arta.waybar; + in { + options.arta.waybar = { + extraConfig = lib.mkOption { + type = lib.types.lazyAttrsOf lib.types.unspecified; + default = {}; + }; + }; + + config = { + programs.waybar = { + enable = true; + settings = [ + (lib.mkMerge [ + { + layer = "top"; + position = "top"; + height = 20; + + "custom/sep" = { + format = "|"; + interval = "once"; + tooltip = false; + }; + + "backlight" = { + format = "bl {percent}%"; + tooltip = false; + }; + + "battery" = { + format = "bat {capacity}%"; + format-charging = "bat+ {capacity}%"; + format-discharging = "bat- {capacity}%"; + tooltip = false; + }; + + "bluetooth" = { + format = "bt {status}"; + on-click = "foot bluetui"; + tooltip = false; + }; + + "clock" = { + format = "{:%F %H:%M}"; + tooltip = false; + }; + + "disk" = { + format = "avail {total}"; + tooltip = false; + }; + + "hyprland/language" = { + format-en = "us"; + format-fi = "fi"; + format-no = "no"; + }; + + "hyprland/workspaces" = { + all-outputs = true; + persistent-workspaces."*" = 9; + }; + + "network" = { + format-ethernet = "{ipaddr}/{cidr}"; + format-wifi = "{ipaddr} ({essid})"; + tooltip = false; + }; + + "niri/language" = { + format-en = "us"; + format-fi = "fi"; + format-no = "no"; + }; + + "wireplumber" = { + format = "vol {volume}%"; + on-click = "pavucontrol"; + tooltip = false; + }; + } + cfg.extraConfig + ]) + ]; + style = '' + * { + border: none; + border-radius: 0; + min-height: 0; + margin: 0; + padding: 0; + } + + #waybar { + background: #7298bf; + color: #e0c296; + font-family: VictorMono Nerd Font Mono; + font-weight: 700; + font-size: 12px; + } + + #workspaces button { + background: #7298bf; + color: #888888; + } + + #workspaces button.empty { + background: #3f546a; + } + + /* Hyprland */ + #workspaces button.visible { + background: #7298bf; + color: #e0c296; + } + + /* Niri */ + #workspaces button.focused { + background: #7298bf; + color: #e0c296; + } + + #custom-sep { + margin: 0 0.25em; + } + ''; + }; + }; + }; +} -- 2.44.1