about summary refs log tree commit diff
path: root/users/fcuny/desktop/wm
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--users/fcuny/desktop/wm/bar.nix158
-rw-r--r--users/fcuny/desktop/wm/default.nix46
2 files changed, 132 insertions, 72 deletions
diff --git a/users/fcuny/desktop/wm/bar.nix b/users/fcuny/desktop/wm/bar.nix
index 3bb2560..1637f5c 100644
--- a/users/fcuny/desktop/wm/bar.nix
+++ b/users/fcuny/desktop/wm/bar.nix
@@ -1,33 +1,137 @@
 { pkgs, ... }:
 
 {
-  programs.i3status-rust = {
+  programs.waybar = {
     enable = true;
-    bars.default = {
-      settings.theme.name = "plain";
-      icons = "awesome5";
-      blocks = [
-        {
-          block = "net";
-          format = "{ssid} {signal_strength} {ip}";
-          interval = 5;
-        }
-        {
-          block = "battery";
-          interval = 30;
-          format = "{percentage}";
-        }
-        {
-          block = "sound";
-          on_click = "${pkgs.pavucontrol}/bin/pavucontrol";
-        }
-        {
-          block = "time";
-          interval = 1;
-          format = "%Y-%m-%d %H:%M:%S";
-          icons_format = "";
-        }
-      ];
-    };
+    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}% {icon} ({format_source})";
+          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 = ''
+      * {
+        border-radius: 0;
+        border: none;
+        margin: 0;
+        min-height: 0;
+        padding: 0;
+      }
+      #waybar {
+        background: #000000;
+        color: white;
+        font-family: Source Code Pro;
+        font-size: 15px;
+      }
+      #tray {
+        /* No styles */
+      }
+      #window {
+        font-weight: bold;
+      }
+      #workspaces button {
+        border-top: #333333;
+        background-color: #000000;
+        /* To compensate for the top border and still have vertical centering */
+        padding-bottom: 2px;
+        color: #ffffff;
+      }
+      #workspaces button.visible {
+        border-color: #333333;
+        background-color: #5f676a;
+      }
+      #workspaces button.focused {
+        border-color: #4c7899;
+        background-color: #285577;
+      }
+      #workspaces button.urgent {
+        border-color: #2f343a;
+        background-color: #900000;
+      }
+      #clock,
+      #battery,
+      #network,
+      #pulseaudio,
+      #tray,
+      #mode {
+        padding-left: 10px;
+        padding-right: 10px;
+      }
+      #mode {
+        background: #64727D;
+        border-top: 2px solid white;
+        /* To compensate for the top border and still have vertical centering */
+        padding-bottom: 2px;
+      }
+      #clock {
+        /* No styles */
+      }
+      #battery {
+        animation-timing-function: linear;
+        animation-iteration-count: infinite;
+        animation-direction: alternate;
+      }
+      #battery.discharging {
+        color: #90a1ad;
+      }
+      #battery.charging {
+        color: #fffff8;
+      }
+      #battery.warning {
+        border-bottom: 2px solid #ff9e21;
+      }
+      #battery.critical {
+        border-bottom: 2px solid #ff3121;
+      }
+      #network {
+        /* No styles */
+      }
+      #network.disconnected {
+        color: orange;
+      }
+      #pulseaudio {
+        /* No styles */
+      }
+      #pulseaudio.muted {
+        color: #90a1ad;
+      }
+    '';
   };
 }
diff --git a/users/fcuny/desktop/wm/default.nix b/users/fcuny/desktop/wm/default.nix
index ffa03e7..4f39c14 100644
--- a/users/fcuny/desktop/wm/default.nix
+++ b/users/fcuny/desktop/wm/default.nix
@@ -29,51 +29,7 @@
       modifier = "Mod4";
       terminal = "${config.programs.alacritty.package}/bin/alacritty";
       menu = ''${pkgs.wofi}/bin/wofi -S drun -p "app:" -L 10'';
-      bars = [{
-        position = "top";
-        fonts = {
-          names = [ "Source Code Pro" "FontAwesome5Free" ];
-          style = "Regular";
-          size = 11.0;
-        };
-        statusCommand =
-          "${pkgs.i3status-rust}/bin/i3status-rs ~/.config/i3status-rust/config-default.toml";
-        colors = {
-          background = "#2E3440AA";
-          statusline = "#88C0D0";
-          separator = "#3B4252";
-
-          focusedWorkspace = {
-            border = "#88C0D0";
-            background = "#88C0D0";
-            text = "#2E3440";
-          };
-
-          activeWorkspace = {
-            border = "#4C566ADD";
-            background = "#4C566ADD";
-            text = "#D8DEE9";
-          };
-
-          inactiveWorkspace = {
-            border = "#3B4252DD";
-            background = "#3B4252DD";
-            text = "#E5E9F0";
-          };
-
-          urgentWorkspace = {
-            border = "#B48EAD";
-            background = "#B48EAD";
-            text = "#ECEFF4";
-          };
-
-          bindingMode = {
-            border = "#BF616A";
-            background = "#BF616A";
-            text = "#E5E9F0";
-          };
-        };
-      }];
+      bars = [ ];
       fonts = {
         names = [ "Source Code Pro" ];
         size = 10.0;