From f677db7cb5e3807dc96e34ffeabf42c008205ad0 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Tue, 30 May 2023 04:17:44 -0500 Subject: [PATCH] perf(waybar): fix some bugs causing high cpu usage in waybar --- dots/.config/waybar/config | 6 ++---- dots/.config/waybar/scripts/get-media.bash | 2 +- dots/.config/waybar/style.css | 5 ++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dots/.config/waybar/config b/dots/.config/waybar/config index cc39c8b9..80f1e54c 100644 --- a/dots/.config/waybar/config +++ b/dots/.config/waybar/config @@ -23,12 +23,11 @@ "custom/lock" ], "custom/launcher": { - "format": "{}", + "format": "󰫢", "tooltip": false, "min-length": 5, - "interval": 1, "on-click": "wofi", - "exec": "printf '󰫢'" + "interval": "once" }, "battery": { "min-length": 5, @@ -196,7 +195,6 @@ "return-type": "json", "on-click": "playerctl play-pause", "exec": "~/.config/waybar/scripts/get-media.bash", - "escape": true } } ] diff --git a/dots/.config/waybar/scripts/get-media.bash b/dots/.config/waybar/scripts/get-media.bash index f7203da2..d4d66f42 100755 --- a/dots/.config/waybar/scripts/get-media.bash +++ b/dots/.config/waybar/scripts/get-media.bash @@ -21,7 +21,7 @@ get-album-info () { fi printf '{"class": "%s", "text": "%s"}\n' "${class}" "${text}" - sleep .08 + sleep .5 done } diff --git a/dots/.config/waybar/style.css b/dots/.config/waybar/style.css index 6298443a..7ee303fa 100644 --- a/dots/.config/waybar/style.css +++ b/dots/.config/waybar/style.css @@ -83,7 +83,10 @@ rgba(149, 127, 184, 0.9) ); background-size: 400% 400%; - animation: gradient_scroll 10s ease infinite; + /* + * NOTE: As much as I'd love to have this animation on, gtk enjoys being a massive pile of shit and causes the CPU to + * turn into a space heater. */ + /* animation: gradient_scroll 10s ease infinite; */ } /* Launcher */