about summary refs log tree commit diff
path: root/home/wm/waybar/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/wm/waybar/default.nix')
-rw-r--r--home/wm/waybar/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/home/wm/waybar/default.nix b/home/wm/waybar/default.nix
new file mode 100644
index 0000000..c1bf601
--- /dev/null
+++ b/home/wm/waybar/default.nix
@@ -0,0 +1,52 @@
+{ config, lib, pkgs, ... }:
+let isEnabled = config.my.home.wm.windowManager == "sway";
+in {
+  config = lib.mkIf isEnabled {
+    programs.waybar = {
+      enable = true;
+      systemd = { enable = true; };
+
+      settings = [{
+        layer = "bottom";
+        position = "top";
+        margin-top = 0;
+        margin-left = 0;
+        margin-right = 0;
+        margin-bottom = 0;
+        modules-left = [ "sway/workspaces" "sway/mode" ];
+        modules-right = [ "pulseaudio" "network" "battery" "clock" "tray" ];
+        modules = {
+          "sway/workspaces" = { format = "{name}"; };
+          "sway/mode" = { format = "{}"; };
+          tray = { spacing = 10; };
+          clock = { format = "{: %a %b %d %R}"; };
+          battery = {
+            states = {
+              warning = 30;
+              critical = 15;
+            };
+            format = "ac:{capacity}%";
+            tooltip = true;
+            tooltip-format = "{timeTo} ({capacity}%)";
+          };
+          pulseaudio = {
+            format = "vol:{volume}%";
+            format-bluetooth = "bt:{volume}%";
+            format-bluetooth-muted = "bt:{volume}%";
+            format-muted = "vol:{volume}%";
+            on-click = "pavucontrol";
+          };
+          "network" = {
+            format-wifi = "{essid}:{signalStrength}%";
+            format-ethernet = "{ipaddr}/{cidr}";
+            format-linked = "{ifname} (No IP)";
+            format-disconnected = "network unavailable";
+            format-alt = "{ifname}: {ipaddr}/{cidr}";
+            tooltip = false;
+          };
+        };
+      }];
+      style = (builtins.readFile ./style.css);
+    };
+  };
+}