aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wilken2024-07-12 22:04:09 +0200
committerTimo Wilken2024-07-12 22:04:09 +0200
commitf4d47c96946775c9cbcd93e21565ccf01d85c6a3 (patch)
tree623706bdd043e65a7426ed28a0fd60049d7a282f
parente6f26581bf22e266c5056eddfb264eca2efb6ef4 (diff)
Make waybar more similar to previous polybar config
-rw-r--r--tw/gexp.scm9
-rw-r--r--tw/services/desktop.scm50
-rw-r--r--tw/services/files/waybar.css10
3 files changed, 43 insertions, 26 deletions
diff --git a/tw/gexp.scm b/tw/gexp.scm
index 0770f250..49021ebd 100644
--- a/tw/gexp.scm
+++ b/tw/gexp.scm
@@ -22,9 +22,10 @@
'#$files)))))))
(define-public (json-file name value)
+ "A file called NAME containing the JSON-serialised VALUE."
(computed-file name
(with-extensions (list guile-json-4)
- #~(begin
- (use-modules (json) (srfi srfi-26))
- (call-with-output-file #$output
- (cut scm->json '#$value <> #:unicode #t))))))
+ #~(call-with-output-file #$output
+ (lambda (port)
+ (set-port-encoding! port "UTF-8")
+ ((@ (json) scm->json) '#$value port #:unicode #t))))))
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 . #("<span face='OpenMoji' fallback='false' color='#f38ba8'>๐Ÿ“ถ</span>"
- "<span face='OpenMoji' fallback='false' color='#f9e2af'>๐Ÿ“ถ</span>"
- "<span face='OpenMoji' fallback='false' color='#a6e3a1'>๐Ÿ“ถ</span>"))
(format . "{ifname}")
- (format-ethernet . "<span face='OpenMoji' fallback='false'>๐ŸŒ</span> โ†“ {bandwidthDownBytes} โ†‘ {bandwidthUpBytes}")
- (format-wifi . "{icon} {essid} โ†“ {bandwidthDownBytes} โ†‘ {bandwidthUpBytes}")
+ (format-ethernet . "<span face='OpenMoji' fallback='false' color='#a6e3a1'>๐ŸŒ</span> <span color='#a6adc8'>โ‡… {bandwidthTotalBytes}</span>")
+ (format-wifi . "{icon} {essid} <span color='#a6adc8'>โ‡… {bandwidthTotalBytes}</span>")
+ (format-icons . #("<span face='OpenMoji' fallback='false' color='#f38ba8'>๐Ÿ“ถ</span>"
+ "<span face='OpenMoji' fallback='false' color='#f9e2af'>๐Ÿ“ถ</span>"
+ "<span face='OpenMoji' fallback='false' color='#a6e3a1'>๐Ÿ“ถ</span>"))
(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 "<span color='#a6adc8'>CPU</span> "
+ (map (cut format #f "{icon~d}" <>)
+ (iota num-cores))))
(format-icons . #("<span color='#585b70'>โ–</span>"
"<span color='#cdd6f4'>โ–‚</span>"
"<span color='#cdd6f4'>โ–ƒ</span>"
@@ -463,14 +472,18 @@ display."))
"<span color='#f9e2af'>โ–‡</span>"
"<span color='#f9e2af'>โ–ˆ</span>")))
+ (temperature
+ (format . "<span color='#a6e3a1'>๐ŸŒก</span> {temperatureC}ยฐC")
+ (format-critical . "<span color='#f38ba8'>๐ŸŒก</span> {temperatureC}ยฐC"))
+
(memory
(interval . 5)
- (format . "<span color='#cdd6f4'>RAM</span> {used} GiB"))
+ (format . "<span color='#a6adc8'>RAM</span> {used} GiB"))
(battery
(states (medium . 80) (critical . 20))
- (format-discharging . "{icon} {capacity}% {power}W {time}")
- (format-charging . "<span face='OpenMoji' fallback='false'>๐Ÿ”Œ</span> {capacity}% {power}W {time}")
+ (format-discharging . "{icon} {capacity}% {power:.1f}W {time}")
+ (format-charging . "<span face='OpenMoji' fallback='false' color='#a6e3a1'>๐Ÿ”Œ</span> {capacity}% {power:.1f}W {time}")
(format-full . "")
(format-icons . #("<span face='OpenMoji' fallback='false' color='#f38ba8'>๐Ÿ”‹</span>"
"<span face='OpenMoji' fallback='false' color='#f9e2af'>๐Ÿ”‹</span>"
@@ -480,8 +493,9 @@ display."))
(pulseaudio
(scroll-step . 1)
- (format . "{icon} {volume}%")
- (format-muted . "<span face='OpenMoji' fallback='false'>๐Ÿ”‡</span>")
+ (format . "<span color='#f9e2af'>{icon}</span> {volume}%")
+ (format-bluetooth . "<span color='#89b4fa'>{icon}</span> {volume}%")
+ (format-muted . "<span face='OpenMoji' fallback='false' color='#a6adc8'>๐Ÿ”‡</span>")
(format-icons (default . #("<span face='OpenMoji' fallback='false'>๐Ÿ”ˆ</span>"
"<span face='OpenMoji' fallback='false'>๐Ÿ”‰</span>"
"<span face='OpenMoji' fallback='false'>๐Ÿ”Š</span>")))
@@ -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;
+}