Commit 811664d952db

Vincent Demeester <vincent@sbr.pm>
2022-09-06 21:11:51
users/vincent: customize waybar a bit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent bd79036
Changed files (2)
users
vincent
users/vincent/desktop/sway.nix
@@ -154,6 +154,10 @@ in
             title = "^_emacs scratchpad_$";
           };
         }
+        {
+          criteria = { title = "Save File"; };
+          command = "floating enable, resize set width 600px height 800px";
+        }
         {
           criteria = { class = "pavucontrol"; };
           command = "floating enable";
@@ -230,15 +234,35 @@ in
     waybar = {
       enable = true;
       systemd.enable = true;
+      style = ./waybar.css;
       settings = [{
         layer = "bottom";
         position = "bottom";
         mode = "hide";
         modules-left = [ "sway/workspaces" "sway/mode" "custom/media" ];
-        modules-center = [ "sway/window" ];
-        modules-right = [ "idle_inhibitor" "pulseaudio" "temperature" "backlight" "sway/language" "battery" "clock" "tray" ];
+        modules-center = [ "clock" ];
+        modules-right = [ "idle_inhibitor" "network" "temperature" "battery#bat0" "tray" ];
         ipc = true;
         id = "mainBar";
+        "clock" = {
+          "interval" = 30;
+          "format" = "{:<b>%H:%M</b>}";
+          "tooltip-format" = "<big><b>{:%Y %B}</b></big>\n{calendar}";
+          "format-alt" = "{:%A %d %B %Y}";
+        };
+        "battery#bat0" = {
+          "bat" = "BAT0";
+          "states" = {
+            "warning" = 30;
+            "critical" = 15;
+          };
+          "format" = "{icon} {capacity}";
+          "format-charging" = "\uf0e7 {capacity}";
+          "format-plugged" = "";
+          "format-alt" = "{icon} {time}";
+          "format-full" = "";
+          "format-icons" = [ "" "" "" "" "" ];
+        };
       }];
     };
     mako = {
users/vincent/desktop/waybar.css
@@ -0,0 +1,131 @@
+@keyframes blink-warning {
+    to {
+        background-color: #bf616a;
+    }
+}
+
+@keyframes blink-critical {
+    to {
+        color: #2e3440;
+        background-color: #bf616a;
+    }
+}
+
+* {
+    border: none;
+    border-radius: 0;
+    font-family: Noto Mono, monospace;
+    font-size: 13px;
+    min-height: 0;
+    box-shadow: none;
+    text-shadow: none;
+}
+
+window#waybar {
+    background-color: #3b4252;
+    color: #e5e9f0;
+    opacity: 0.9;
+}
+
+#window {
+    font-family: Noto Sans, sans-serif;
+}
+
+#workspaces {
+    background-color: #4c566a;
+}
+
+#workspaces button {
+    padding: 3px 9px 0px 9px;
+    background: transparent;
+    color: #e5e9f0;
+    border-bottom: 3px solid transparent;
+    font-weight: 900;
+}
+
+#workspaces button.focused {
+    background-color: #434c5e;
+    color: #eceff4;
+    border-bottom: 3px solid #ebcb8b;
+}
+
+#workspaces button:hover {
+    background-color: #5e81ac;
+}
+
+#mode {
+    padding: 0px 9px;
+    background-color: #a3be8c;
+    color: #3b4252;
+    font-family: Noto Sans, sans-serif;
+    font-size: 14px;
+    font-weight: bold;
+}
+
+#clock, #language, #pulseaudio, #tray, #memory, #cpu, #battery {
+    padding: 0px 8px;
+    color: #d8dee9;
+    font-size: 14px;
+}
+
+#clock {
+    background-color: #4c566a;
+    font-weight: bold;
+}
+
+#language {
+    color: #d8dee9;
+    font-weight: bold;
+}
+
+#pulseaudio {
+}
+
+#pulseaudio.muted {
+    color: #d08770;
+}
+
+#tray {
+}
+
+#cpu {
+    padding-left: 0px;
+    font-size: 13px;
+}
+
+#cpu.warning {
+    color: #ebcb8b;
+}
+
+#cpu.critical {
+    color: #d08770;
+}
+
+#memory {
+    padding-left: 0px;
+    font-size: 13px;
+}
+
+#memory.warning {
+    color: #ebcb8b;
+}
+
+#memory.critical {
+    color: #d08770;
+}
+
+#battery {
+    animation-timing-function: ease-in-out;
+    animation-iteration-count: infinite;
+    animation-direction: alternate;
+}
+
+#battery.warning.discharging {
+    animation-name: blink-warning;
+    animation-duration: 3s;
+}
+
+#battery.critical.discharging {
+    animation-name: blink-critical;
+    animation-duration: 2s;
+}