From 8f01f1417063da96214e1e2a011cb681b021a70a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?=
 <yps@yaroslavps.com>
Date: Sat, 3 May 2025 01:48:57 +0300
Subject: waybar: config cleanup and style changes

---
 dotfiles/.config/waybar/config       | 215 ++---------------------------------
 dotfiles/.config/waybar/modules.json | 168 +++++++++++++++++++++++++++
 dotfiles/.config/waybar/style.css    |  80 +++++--------
 3 files changed, 208 insertions(+), 255 deletions(-)
 create mode 100644 dotfiles/.config/waybar/modules.json

(limited to 'dotfiles')

diff --git a/dotfiles/.config/waybar/config b/dotfiles/.config/waybar/config
index 216120f..5131532 100644
--- a/dotfiles/.config/waybar/config
+++ b/dotfiles/.config/waybar/config
@@ -1,225 +1,28 @@
 // vim: filetype=json
-{
+[{
     "layer": "top",
-    "height": 36,
+    "height": 34,
+	"include": [ "~/.config/waybar/modules.json" ],
     "modules-left": [
-        "sway/workspaces",
         "niri/workspaces",
-        "sway/mode",
-        "custom/waybar-mpris",
-        "pulseaudio"
+        "mpris",
+        "wireplumber"
     ],
     "modules-center": [
         "clock",
         "custom/weather"
     ],
     "modules-right": [
-        "custom/rec-status",
-        "custom/swaykbd",
         "custom/mail-status",
+        "cpu",
         "memory",
         "backlight",
         "battery#bat0",
         "battery#bat1",
         "custom/batwatt",
+        "custom/torrent-status",
         "network",
         "niri/language",
-        "custom/torrent-status",
         "tray"
-    ],
-    "sway/mode": {
-        "format": "<span style=\"italic\">{}</span>"
-    },
-    "custom/waybar-mpris": {
-    	"return-type": "json",
-    	"exec": "waybar-mpris --autofocus --text-format=\"%i [%p] %a - %t\" --tooltip-format=\"%t by %a from %A\n%p/%d\n(%P)\" --pause='<span color=\"#5b8277\"></span>' --play='' --max-title 30",
-    	"on-click": "lmc toggle",
-    	"on-click-right": "lmc next",
-    	"max-length": 80
-    },
-    "mpd": {
-        "format": " {stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon} [{elapsedTime:%M:%S}] {artist} - {title}",
-        "format-disconnected": " Connection lost ",
-        "format-stopped": "  {consumeIcon}{randomIcon}{repeatIcon}{singleIcon} [--:--] -- - --",
-        "unknown-tag": "N/A",
-        "interval": 2,
-        "max-length": 60,
-        "consume-icons": {
-            "on": " "
-        },
-        "random-icons": {
-            "on": ""
-        },
-        "repeat-icons": {
-            "on": " "
-        },
-        "single-icons": {
-            "on": "[s]"
-        },
-        "state-icons": {
-            "paused": "<span color=\"#b2872f\"></span>",
-            "playing": "<span color=\"#5b8277\"></span>"
-        },
-        "tooltip-format": "MPD now playing: {artist} - {title}",
-        "tooltip-format-disconnected": "MPD disconnected"
-    },
-    "idle_inhibitor": {
-        "format": "{icon}",
-        "format-icons": {
-            "activated": "",
-            "deactivated": ""
-        }
-    },
-    "tray": {
-        "icon-size": 16,
-        "spacing": 10
-    },
-    "clock": {
-        "format": "{:%Y年%m月%d日 %H:%M:%S}",
-        "tooltip-format": "{calendar}",
-        "calendar": {
-        	"mode": "year",
-        	"mode-mon-col": 3
-        },
-        "interval": 1
-    },
-    "cpu": {
-        "format": "{usage}% ",
-        "tooltip": false
-    },
-    "memory": {
-        "format": "<span color=\"#5b8277\"></span> {used:0.3f}G",
-        "states": {
-        	"warning": 90
-        },
-        "interval": 10
-    },
-    "temperature": {
-        // "thermal-zone": 2,
-        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
-        "critical-threshold": 80,
-        // "format-critical": "{temperatureC}°C {icon}",
-        "format": "{temperatureC}°C {icon}",
-        "format-icons": ["", "", ""]
-    },
-    "backlight": {
-        // "device": "acpi_video1",
-        "format": "<span color=\"#5b8277\">{icon}</span> {percent}%",
-        "format-icons": ["", ""]
-    },
-    "battery#bat0": {
-        "bat": "BAT0",
-        "format": "{icon} {capacity}%",
-        "format-charging": " <span color=\"#5b8277\"></span> {capacity}%",
-        "format-plugged": "<span color=\"#5b8277\"></span> {capacity}%",
-        "format-icons": [
-            "<span color=\"#b73030\"></span>",
-            "<span color=\"#b2872f\"></span>",
-            "<span color=\"#5b8277\"></span>",
-            "<span color=\"#5b8277\"></span>",
-            "<span color=\"#5b8277\"></span>"
-        ]
-    },
-    "battery#bat1": {
-        "bat": "BAT1",
-        "format": "{icon} {capacity}%",
-        "format-charging": " <span color=\"#5b8277\"></span> {capacity}%",
-        "format-plugged": "<span color=\"#5b8277\"></span> {capacity}%",
-        "format-icons": [
-            "<span color=\"#b73030\"></span>",
-            "<span color=\"#b2872f\"></span>",
-            "<span color=\"#5b8277\"></span>",
-            "<span color=\"#5b8277\"></span>",
-            "<span color=\"#5b8277\"></span>"
-        ]
-    },
-    "network": {
-        // "interface": "wlp2*", // (Optional) To force the use of this interface
-        "format-wifi": "<span color=\"#5b8277\"></span>  {essid}",
-        "format-ethernet": "<span color=\"#5b8277\"></span>  {ifname}",
-        "format-linked": "<span color=\"#5b8277\"></span>  {ifname}",
-        "format-disconnected": "  disconnected",
-        "format-alt": "{ifname}: {ipaddr}/{cidr}",
-        "tooltip-format": "{ifname}: {ipaddr}/{cidr}"
-    },
-    "pulseaudio": {
-        "scroll-step": 2, // %, can be a float
-        "format": "<span color=\"#5b8277\">{icon}</span> {volume}%",
-        "format-bluetooth": "<span color=\"#5b8277\">{icon}</span> {volume}% {format_source}",
-        "format-muted": "<span color=\"#b2872f\"></span>",
-        "format-source": "{volume}% ",
-        "format-source-muted": "",
-        "format-icons": {
-            "headphone": "",
-            "handsfree": "",
-            "headset": "",
-            "phone": "",
-            "portable": "",
-            "car": "",
-            "default": ["", "", ""]
-        },
-        "on-click": "$TERMINAL -e ncpamixer"
-    },
-    "custom/rec-status": {
-        "format": "<span color=\"#5b8277\">{}</span>",
-        "signal": 5,
-        "interval": "once",
-        "exec": "barrecstatus"
-    },
-    "custom/torrent-status": {
-        "format": "<span color=\"#5b8277\">{}</span>",
-        "signal": 10,
-        "interval": "once",
-        "exec": "bartorrentstatus"
-    },
-    "custom/mail-status": {
-        "format": "<span color=\"#5b8277\">📧</span> {}",
-        "signal": 9,
-        "interval": "once",
-        "exec": "barmailstatus",
-        "tooltip": false
-    },
-    "custom/pac-status": {
-        "format": "<span color=\"#5b8277\"></span> {}",
-        "signal": 7,
-        "interval": "once",
-        "exec": "barpacstatus"
-    },
-    "custom/news-status": {
-        "format": "<span color=\"#5b8277\"></span> {}",
-        "signal": 8,
-        "interval": "once",
-        "exec": "barnewsstatus",
-        "tooltip": false
-    },
-    "custom/weather": {
-        "format": "{}",
-        "interval": 180,
-        "exec": "barweather"
-    },
-    "custom/ds4battery": {
-        "format": "🎮 {}",
-        "interval": 180,
-        "exec": "bards4battery"
-    },
-    "custom/batwatt": {
-    	"return-type": "json",
-        "interval": 10,
-        "exec-if": "test -e /sys/class/power_supply/BAT0",
-        "exec": "barbatwatt",
-        "exec-on-event": true,
-        "on-click": ""
-    },
-    "custom/swaykbd": {
-        "format": "{}",
-        "exec": "swaykbd",
-        "tooltip": false
-    },
-    "niri/language": {
-    	"on-click": "niri msg action switch-layout next",
-    	"on-click-right": "niri msg action switch-layout prev",
-    	"format-en": " 🇺🇸 EN ",
-    	"format-es": " 🇲🇽 ES ",
-    	"format-ru": " 🇷🇺 RU "
-    }
-}
+    ]
+}]
diff --git a/dotfiles/.config/waybar/modules.json b/dotfiles/.config/waybar/modules.json
new file mode 100644
index 0000000..2c93756
--- /dev/null
+++ b/dotfiles/.config/waybar/modules.json
@@ -0,0 +1,168 @@
+{
+    "sway/mode": {
+        "format": "<span style=\"italic\">{}</span>"
+    },
+    "mpris": {
+    	"format": "{status_icon} {artist} - {title}",
+    	"format-stopped": "{status_icon} - ",
+    	"status-icons": {
+    		"stopped": "",
+    		"paused": "",
+    		"playing": "<span color=\"#5b8277\"></span>"
+    	},
+    	"artist-len": 25,
+    	"title-len": 40
+    },
+    "tray": {
+        "icon-size": 16,
+        "spacing": 10
+    },
+    "clock": {
+        "format": "{:%Y年%m月%d日 %H:%M:%S}",
+        "tooltip-format": "{calendar}",
+        "calendar": {
+        	"mode": "year",
+        	"mode-mon-col": 3
+        },
+        "interval": 1
+    },
+    "cpu": {
+        "format": "<span color=\"#e0d8b3\"></span> {load}%",
+        "interval": 2
+    },
+    "memory": {
+        "format": "<span color=\"#e0d8b3\"> </span> {used:0.3f}G",
+        "states": {
+        	"warning": 90
+        },
+        "interval": 10
+    },
+    "temperature": {
+        // "thermal-zone": 2,
+        // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
+        "critical-threshold": 80,
+        // "format-critical": "{temperatureC}°C {icon}",
+        "format": "{temperatureC}°C {icon}",
+        "format-icons": ["", "", ""]
+    },
+    "backlight": {
+        // "device": "acpi_video1",
+        "format": "<span color=\"#5b8277\">{icon}</span> {percent}%",
+        "format-icons": ["", ""]
+    },
+    "battery#bat0": {
+        "bat": "BAT0",
+        "format": "{icon} {capacity}%",
+        "format-charging": " <span color=\"#5b8277\"></span> {capacity}%",
+        "format-plugged": "<span color=\"#5b8277\"></span> {capacity}%",
+        "format-icons": [
+            "<span color=\"#b73030\"></span>",
+            "<span color=\"#b2872f\"></span>",
+            "<span color=\"#5b8277\"></span>",
+            "<span color=\"#5b8277\"></span>",
+            "<span color=\"#5b8277\"></span>"
+        ]
+    },
+    "battery#bat1": {
+        "bat": "BAT1",
+        "format": "{icon} {capacity}%",
+        "format-charging": " <span color=\"#5b8277\"></span> {capacity}%",
+        "format-plugged": "<span color=\"#5b8277\"></span> {capacity}%",
+        "format-icons": [
+            "<span color=\"#b73030\"></span>",
+            "<span color=\"#b2872f\"></span>",
+            "<span color=\"#5b8277\"></span>",
+            "<span color=\"#5b8277\"></span>",
+            "<span color=\"#5b8277\"></span>"
+        ]
+    },
+    "network": {
+        // "interface": "wlp2*", // (Optional) To force the use of this interface
+        "format-wifi": "<span color=\"#5b8277\"></span>  {essid}",
+        "format-ethernet": "<span color=\"#5b8277\"></span>  {ifname}",
+        "format-linked": "<span color=\"#5b8277\"></span>  {ifname}",
+        "format-disconnected": "  disconnected",
+        "format-alt": "{ifname}: {ipaddr}/{cidr}",
+        "tooltip-format": "{ifname}: {ipaddr}/{cidr}"
+    },
+    "wireplumber": {
+        "scroll-step": 2, // %, can be a float
+        "format": "<span color=\"#5b8277\">{icon}</span> {volume}%",
+        "format-bluetooth": "<span color=\"#5b8277\">{icon}</span> {volume}% {format_source}",
+        "format-muted": "<span color=\"#b2872f\"></span>",
+        "format-source": "{volume}% ",
+        "format-source-muted": "",
+        "format-icons": {
+            "headphone": "",
+            "handsfree": "",
+            "headset": "",
+            "phone": "",
+            "portable": "",
+            "car": "",
+            "default": ["", "", ""]
+        },
+        "on-click": "$TERMINAL -e ncpamixer"
+    },
+    "custom/rec-status": {
+        "format": "<span color=\"#5b8277\">{}</span>",
+        "signal": 5,
+        "interval": "once",
+        "exec": "barrecstatus"
+    },
+    "custom/torrent-status": {
+        "format": "<span color=\"#e0d8b3\">{}</span>",
+        "signal": 10,
+        "interval": "once",
+        "exec": "bartorrentstatus"
+    },
+    "custom/mail-status": {
+        "format": "<span color=\"#e0d8b3\">󰺻 </span>{}",
+        "signal": 9,
+        "interval": "once",
+        "exec": "barmailstatus",
+        "tooltip": false
+    },
+    "custom/pac-status": {
+        "format": " {}",
+        "signal": 7,
+        "interval": "once",
+        "exec": "barpacstatus"
+    },
+    "custom/news-status": {
+        "format": " {}",
+        "signal": 8,
+        "interval": "once",
+        "exec": "barnewsstatus",
+        "tooltip": false
+    },
+    "custom/weather": {
+        "format": "{}",
+        "interval": 180,
+        "exec": "barweather"
+    },
+    "custom/ds4battery": {
+        "format": "🎮 {}",
+        "interval": 180,
+        "exec": "bards4battery"
+    },
+    "custom/batwatt": {
+    	"return-type": "json",
+        "interval": 10,
+        "exec-if": "test -e /sys/class/power_supply/BAT0",
+        "exec": "barbatwatt",
+        "exec-on-event": true,
+        "on-click": ""
+    },
+    "custom/swaykbd": {
+        "format": "{}",
+        "exec": "swaykbd",
+        "tooltip": false
+    },
+    "niri/language": {
+    	"on-click": "niri msg action switch-layout next",
+    	"on-click-right": "niri msg action switch-layout prev",
+    	"format-en": " 🇺🇸 ",
+    	"format-es": " 🇲🇽 ",
+    	"format-ru": " 🇷🇺 "
+    },
+}
diff --git a/dotfiles/.config/waybar/style.css b/dotfiles/.config/waybar/style.css
index 1871a66..e69365a 100644
--- a/dotfiles/.config/waybar/style.css
+++ b/dotfiles/.config/waybar/style.css
@@ -3,65 +3,26 @@
   	font-family: monospace;
 }
 window#waybar {
-  	background: #000000;
-  	/* background: linear-gradient(#000000, #151515); */
+  	background: #1e1c1a;
   	color: #f2eccf;
   	min-height: 0;
-  	border-bottom: 2px solid #33333a;
-}
-#tray,
-#language,
-#custom-torrent-status,
-#workspaces {
-  	background: #151517;
-  	margin: 3px 0 3px 0;
-  	border-style: solid;
-  	border-color: #33333a;
+  	border: 2px solid #33333a;
 }
 #memory.warning {
 	color: #b2872f;
 }
-#tray{
-  	border-width: 2px 2px 2px 0;
-}
-#custom-torrent-status{
-  	border-width: 2px 0 2px 0;
-}
-#language {
-  	border-width: 2px 0 2px 2px;
-}
-#workspaces {
-  	padding: 0;
-  	margin-right: 6px;
-  	border-width: 2px;
-}
-#workspaces button {
-  	padding: 0 0.6em;
-  	color: #fcf8e2;
-  	border-radius: 0;
-  	border: 1px solid rgba(0, 0, 0, 0);
-}
-#workspaces button.visible {
-  	color:  #7fac96;
-  	border-color: #7fac96;
-}
-#workspaces button.focused {
-  	color:  #000000;
-  	border-color: #7fac96;
-  	background: linear-gradient(60deg, #5b8277, #99d0b5);
-}
-#workspaces button:hover {
-  	border: 1px solid #5b8277;
-}
+#cpu,
 #mpd,
 #tray,
 #clock,
+#mpris,
 #memory,
 #battery,
 #network,
 #backlight,
-#pulseaudio,
+#workspaces,
 #temperature,
+#wireplumber,
 #custom-weather,
 #custom-swaykbd,
 #custom-ds4battery,
@@ -69,12 +30,33 @@ window#waybar {
 #custom-pac-status,
 #custom-mail-status,
 #custom-news-status,
-#custom-waybar-mpris,
 #custom-batwatt,
 #custom-torrent-status {
 	color: #fcf8e2;
-  	padding: 0 6px;
+  	padding: 0 0.4em;
+  	margin: 2px;
+}
+#workspaces {
+  	padding: 0;
+  	margin: 3px;
+  	background: #4a4842;
+}
+#workspaces button {
+  	padding: 0 0.75em;
+  	color: #fcf8e2;
+  	border-radius: 0;
+  	border: 1px solid #1e1e23;
 }
-#custom-weather {
-  	color: #5b8277;
+#workspaces button.visible,
+#workspaces button.active {
+  	color:  #7fac96;
+  	border-color: #7fac96;
+}
+#workspaces button.focused {
+  	color:  #000000;
+  	border-color: #7fac96;
+  	background: linear-gradient(60deg, #5b8277, #99d0b5);
+}
+#workspaces button:hover {
+  	border: 1px solid #5b8277;
 }
-- 
cgit v1.2.3