From f4d47c96946775c9cbcd93e21565ccf01d85c6a3 Mon Sep 17 00:00:00 2001
From: Timo Wilken
Date: Fri, 12 Jul 2024 22:04:09 +0200
Subject: Make waybar more similar to previous polybar config
---
tw/services/desktop.scm | 50 +++++++++++++++++++++++++++-----------------
tw/services/files/waybar.css | 10 ++++++---
2 files changed, 38 insertions(+), 22 deletions(-)
(limited to 'tw/services')
diff --git a/tw/services/desktop.scm b/tw/services/desktop.scm
index a602fdf3..4e73bb56 100644
--- a/tw/services/desktop.scm
+++ b/tw/services/desktop.scm
@@ -429,31 +429,40 @@ display."))
`((reload_style_on_change . #t)
(layer . "top") ; put top bar above other windows' shadows
- (modules-left . #("sway/mode" "sway/workspaces" "sway/window"))
+ (modules-left . #("sway/mode" "sway/workspaces" "custom/separator"
+ "sway/window"))
(modules-center . #())
- (modules-right . #("network" "memory" "cpu" "temperature"
- "keyboard-state" "privacy" "pulseaudio" "battery"
- "clock" "custom/dunst" "tray"))
+ (modules-right . #("network" "custom/separator"
+ "memory" "custom/separator"
+ "cpu" "custom/separator"
+ "temperature" "custom/separator"
+ "pulseaudio" "custom/separator"
+ "battery" "custom/separator"
+ "clock" "custom/dunst" "custom/separator"
+ "tray"))
+
+ (custom/separator (format . "ยท") (interval . "once") (tooltip . #f))
(sway/workspaces (all-outputs . #t) (format . "{name}"))
(sway/window (max-length . 80) (icon . #t) (icon-size . 16))
(network
(interval . 10)
- (icons . #("๐ถ"
- "๐ถ"
- "๐ถ"))
(format . "{ifname}")
- (format-ethernet . "๐ โ {bandwidthDownBytes} โ {bandwidthUpBytes}")
- (format-wifi . "{icon} {essid} โ {bandwidthDownBytes} โ {bandwidthUpBytes}")
+ (format-ethernet . "๐ โ
{bandwidthTotalBytes}")
+ (format-wifi . "{icon} {essid} โ
{bandwidthTotalBytes}")
+ (format-icons . #("๐ถ"
+ "๐ถ"
+ "๐ถ"))
(tooltip-format . "{ifname}")
(tooltip-format-wifi . "{ifname}: {ipaddr} ({signalStrength}%, {frequency}GHz)")
- (tooltip-format-ethernet . "{ifname}: {ipaddr} ({bandwidthTotalBytes}B/s)"))
+ (tooltip-format-ethernet . "{ifname}: {ipaddr} ({bandwidthTotalBytes})"))
(cpu
(interval . 2)
- (format . ,(apply string-append (map (cut format #f "{icon~d}" <>)
- (iota num-cores))))
+ (format . ,(apply string-append "CPU "
+ (map (cut format #f "{icon~d}" <>)
+ (iota num-cores))))
(format-icons . #("โ"
"โ"
"โ"
@@ -463,14 +472,18 @@ display."))
"โ"
"โ")))
+ (temperature
+ (format . "๐ก {temperatureC}ยฐC")
+ (format-critical . "๐ก {temperatureC}ยฐC"))
+
(memory
(interval . 5)
- (format . "RAM {used} GiB"))
+ (format . "RAM {used} GiB"))
(battery
(states (medium . 80) (critical . 20))
- (format-discharging . "{icon} {capacity}% {power}W {time}")
- (format-charging . "๐ {capacity}% {power}W {time}")
+ (format-discharging . "{icon} {capacity}% {power:.1f}W {time}")
+ (format-charging . "๐ {capacity}% {power:.1f}W {time}")
(format-full . "")
(format-icons . #("๐"
"๐"
@@ -480,8 +493,9 @@ display."))
(pulseaudio
(scroll-step . 1)
- (format . "{icon} {volume}%")
- (format-muted . "๐")
+ (format . "{icon} {volume}%")
+ (format-bluetooth . "{icon} {volume}%")
+ (format-muted . "๐")
(format-icons (default . #("๐"
"๐"
"๐")))
@@ -489,8 +503,6 @@ display."))
(on-click . "volume toggle-mute")
(on-click-right . "foot pulsemixer"))
- (keyboard-state (capslock . #t))
-
(custom/dunst
(exec . "echo '{\"alt\": \"'$(dunstctl is-paused)'\"}'")
(return-type . "json")
diff --git a/tw/services/files/waybar.css b/tw/services/files/waybar.css
index c03025fe..0475fde1 100644
--- a/tw/services/files/waybar.css
+++ b/tw/services/files/waybar.css
@@ -17,11 +17,13 @@ tooltip {
label.module {
padding: 5px;
+ margin: 0;
background: transparent;
border-top: 3px solid transparent;
}
box.module {
margin: 0 5px; /* vertical, then horizontal */
+ padding: 0;
background: transparent;
}
@@ -30,9 +32,6 @@ box.module {
background: transparent;
border-top: 3px solid transparent;
}
-#workspaces button {
- border-top: 3px solid @base;
-}
#workspaces button.urgent {
border-top: 3px solid @yellow;
}
@@ -75,3 +74,8 @@ box.module {
#custom-dunst {
border-top: 3px solid @red;
}
+
+#custom-separator {
+ color: @overlay2;
+ padding: 5px 3px;
+}
--
cgit v1.2.3