From 8e4bdc65ca9a2af0726c2cc1249ba87bfb70437c Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" Date: Fri, 29 Dec 2023 21:33:06 +0900 Subject: [PATCH] Implementing custom waybar cava into styles and layouts Rename waybar_cava.sh to WaybarCava.sh remove cava module from the waybar modules bank clean up waybar styles --- config/hypr/scripts/WaybarCava.sh | 29 ++++++++ config/hypr/scripts/waybar_cava.sh | 59 ---------------- config/waybar/configs/[BOT] Default | 2 + config/waybar/configs/[BOT] Default Laptop | 2 + config/waybar/configs/[TOP] Default | 4 +- config/waybar/configs/[TOP] Default Laptop | 2 + config/waybar/modules | 62 +++++++---------- config/waybar/style/Catppuccin-Latte.css | 68 ++++++++++--------- config/waybar/style/Catppuccin-Mocha.css | 5 +- config/waybar/style/Crimson.css | 1 - config/waybar/style/Purpl.css | 2 +- config/waybar/style/Rose Pine.css | 3 +- config/waybar/style/Simple Pink.css | 2 +- .../style/[Black & White] Monochrome.css | 1 - .../[Bordered Pywal] Chroma Fusion Edge.css | 4 +- config/waybar/style/[Colored] Chroma Glow.css | 1 - config/waybar/style/[Colored] Translucent.css | 1 - .../style/[Colorful] Aurora Blossom.css | 1 - config/waybar/style/[Colorful] Aurora.css | 2 +- .../style/[Colorful] Rainbow Spectrum.css | 5 +- config/waybar/style/[Dark] Golden Noir.css | 2 +- config/waybar/style/[Dark] Obsidian Edge.css | 2 +- .../style/[Light] Monochrome Contrast.css | 1 - config/waybar/style/[Light] Obsidian Glow.css | 2 +- config/waybar/style/[Pywal] Chroma Edge.css | 1 - config/waybar/style/[Pywal] Chroma Fusion.css | 5 +- config/waybar/style/[Pywal] Chroma Tally.css | 11 +-- config/waybar/style/[Pywal] Colored.css | 6 +- config/waybar/style/[Pywal] Simple.css | 2 +- config/waybar/style/[Retro] Simple Style.css | 1 - .../style/[Transparent] Crystal Clear.css | 1 - 31 files changed, 130 insertions(+), 160 deletions(-) create mode 100755 config/hypr/scripts/WaybarCava.sh delete mode 100755 config/hypr/scripts/waybar_cava.sh diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh new file mode 100755 index 0000000..458a31b --- /dev/null +++ b/config/hypr/scripts/WaybarCava.sh @@ -0,0 +1,29 @@ +# #! /bin/bash + +#----- Optimized bars animation without much CPU usage increase -------- +bar="▁▂▃▄▅▆▇█" +dict="s/;//g" + +# Calculate the length of the bar outside the loop +bar_length=${#bar} + +# Create dictionary to replace char with bar +for ((i = 0; i < bar_length; i++)); do + dict+=";s/$i/${bar:$i:1}/g" +done + +# Create cava config +config_file="/tmp/bar_cava_config" +cat >"$config_file" < $config_file - -# # read stdout from cava -# cava -p $config_file | while read -r line; do -# echo $line | sed $dict -# done - -# --------------------Optimized bars animation with 1-2% increase in CPU usage ------------------- -bar="▁▂▃▄▅▆▇█" -dict="s/;//g" - -# Calculate the length of the bar outside the loop -bar_length=${#bar} - -# Create dictionary to replace char with bar -for ((i = 0; i < bar_length; i++)); do - dict+=";s/$i/${bar:$i:1}/g" -done - -# Create cava config -config_file="/tmp/polybar_cava_config" -cat >"$config_file" <{}", @@ -545,6 +528,15 @@ "smooth-scrolling-threshold": 1, }, +"custom/power": { + "format": "⏻ ", + "exec": "echo ; echo 󰟡 power // blur", + "on-click": "~/.config/hypr/scripts/Wlogout.sh", + "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", + "interval" : 86400, // once every day + "tooltip": true, +}, + "custom/swaync": { "tooltip":true, "format": "{icon} {}", @@ -565,21 +557,7 @@ "on-click-right": "swaync-client -d -sw", "escape": true, }, - -"custom/power": { - "format": "⏻ ", - "exec": "echo ; echo 󰟡 power // blur", - "on-click": "~/.config/hypr/scripts/Wlogout.sh", - "on-click-right": "~/.config/hypr/scripts/ChangeBlur.sh", - "interval" : 86400, // once every day - "tooltip": true, -}, - -"custom/mviz": { - "exec": "~/.config/hypr/scripts/waybar_cava.sh", - "format": "{}" - }, - + // NOTE:! This is only for Arch and Arch Based Distros "custom/updater":{ "format": " {}", @@ -632,6 +610,12 @@ "interval": "once", "tooltip": false }, + +"custom/separator#blank_3": { + "format": " ", + "interval": "once", + "tooltip": false +}, // Modules below are for vertical layout diff --git a/config/waybar/style/Catppuccin-Latte.css b/config/waybar/style/Catppuccin-Latte.css index 18b1663..187dac2 100644 --- a/config/waybar/style/Catppuccin-Latte.css +++ b/config/waybar/style/Catppuccin-Latte.css @@ -48,7 +48,6 @@ window#waybar.hidden { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -96,15 +95,15 @@ window#waybar.hidden { } #idle_inhibitor { - color: @blue; + color: @blue; } #backlight { - color: @blue; + color: @blue; } #battery { - color: @green; + color: @green; } @keyframes blink { @@ -114,14 +113,14 @@ window#waybar.hidden { } #battery.critical:not(.charging) { - background-color: @red; - color: @theme_text_color; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; - box-shadow: inset 0 -3px transparent; + background-color: @red; + color: @theme_text_color; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + box-shadow: inset 0 -3px transparent; } #bluetooth { @@ -129,28 +128,28 @@ window#waybar.hidden { } #clock { - color: @yellow; + color: @yellow; } #cpu { - color: @green; + color: @green; } #custom-keyboard, #memory { - color: @sky; + color: @sky; } #disk { - color: @sapphire; + color: @sapphire; } #temperature { - color: @teal; + color: @teal; } #temperature.critical { - background-color: @red; + background-color: @red; } #tray > .passive { @@ -161,7 +160,7 @@ window#waybar.hidden { } #keyboard-state { - color: @flamingo; + color: @flamingo; } #workspaces button { @@ -217,57 +216,60 @@ window#waybar.hidden { animation: gradient_f 20s ease-in infinite; transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); } +#custom-cava_mviz { + color: @pink; +} #custom-menu { - color: @rosewater; + color: @rosewater; } #custom-power { - color: @red; + color: @red; } #custom-updater { - color: @red; + color: @red; } #custom-light_dark { - color: @blue; + color: @blue; } #custom-weather { - color: @lavender; + color: @lavender; } #custom-lock { - color: @maroon; + color: @maroon; } #pulseaudio { - color: @sapphire; + color: @sapphire; } #pulseaudio.bluetooth { - color: @pink; + color: @pink; } #pulseaudio.muted { - color: @red; + color: @red; } #window { - color: @mauve; + color: @mauve; } #custom-waybar-mpris { - color:@lavender; + color:@lavender; } #network { - color: @teal; + color: @teal; } #network.disconnected, #network.disabled { - background-color: @surface0; - color: @text; + background-color: @surface0; + color: @text; } #pulseaudio-slider slider { min-width: 0px; diff --git a/config/waybar/style/Catppuccin-Mocha.css b/config/waybar/style/Catppuccin-Mocha.css index 061106c..5f74fe8 100644 --- a/config/waybar/style/Catppuccin-Mocha.css +++ b/config/waybar/style/Catppuccin-Mocha.css @@ -54,7 +54,6 @@ window#waybar.hidden { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -221,6 +220,10 @@ window#waybar.hidden { transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); } +#custom-cava_mviz { + color: @pink; +} + #custom-menu { color: @rosewater; } diff --git a/config/waybar/style/Crimson.css b/config/waybar/style/Crimson.css index fcac5dc..d08b53f 100644 --- a/config/waybar/style/Crimson.css +++ b/config/waybar/style/Crimson.css @@ -110,7 +110,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/Purpl.css b/config/waybar/style/Purpl.css index 0f97470..2e0e4f8 100644 --- a/config/waybar/style/Purpl.css +++ b/config/waybar/style/Purpl.css @@ -120,7 +120,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -139,6 +138,7 @@ tooltip { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/Rose Pine.css b/config/waybar/style/Rose Pine.css index f055b3b..bc9b202 100644 --- a/config/waybar/style/Rose Pine.css +++ b/config/waybar/style/Rose Pine.css @@ -101,7 +101,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -129,7 +128,7 @@ tooltip { #custom-swaync, #custom-updater, #custom-swaync, -#custom-mviz, +#custom-cava_mviz, #custom-weather, #custom-weather.clearNight, #custom-weather.cloudyFoggyDay, diff --git a/config/waybar/style/Simple Pink.css b/config/waybar/style/Simple Pink.css index d306dd8..e60e275 100644 --- a/config/waybar/style/Simple Pink.css +++ b/config/waybar/style/Simple Pink.css @@ -124,7 +124,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -144,6 +143,7 @@ tooltip { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/[Black & White] Monochrome.css b/config/waybar/style/[Black & White] Monochrome.css index 143e887..6c2af3c 100644 --- a/config/waybar/style/[Black & White] Monochrome.css +++ b/config/waybar/style/[Black & White] Monochrome.css @@ -109,7 +109,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Bordered Pywal] Chroma Fusion Edge.css b/config/waybar/style/[Bordered Pywal] Chroma Fusion Edge.css index 1a29c40..5c99c52 100644 --- a/config/waybar/style/[Bordered Pywal] Chroma Fusion Edge.css +++ b/config/waybar/style/[Bordered Pywal] Chroma Fusion Edge.css @@ -51,7 +51,6 @@ window#waybar.empty #window { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -150,6 +149,9 @@ window#waybar.empty #window { color: @teal; } +#custom-cava_mviz{ + color: @color2; +} #workspaces { margin: 1px 1px 1px 1px; padding: 0px 1px; diff --git a/config/waybar/style/[Colored] Chroma Glow.css b/config/waybar/style/[Colored] Chroma Glow.css index f324bf3..dcb5bbc 100644 --- a/config/waybar/style/[Colored] Chroma Glow.css +++ b/config/waybar/style/[Colored] Chroma Glow.css @@ -97,7 +97,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Colored] Translucent.css b/config/waybar/style/[Colored] Translucent.css index 0e3cbaf..49f8dbf 100644 --- a/config/waybar/style/[Colored] Translucent.css +++ b/config/waybar/style/[Colored] Translucent.css @@ -111,7 +111,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Colorful] Aurora Blossom.css b/config/waybar/style/[Colorful] Aurora Blossom.css index 8a0f852..3dd64b4 100644 --- a/config/waybar/style/[Colorful] Aurora Blossom.css +++ b/config/waybar/style/[Colorful] Aurora Blossom.css @@ -97,7 +97,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Colorful] Aurora.css b/config/waybar/style/[Colorful] Aurora.css index a5e57cb..c841c90 100644 --- a/config/waybar/style/[Colorful] Aurora.css +++ b/config/waybar/style/[Colorful] Aurora.css @@ -88,7 +88,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -107,6 +106,7 @@ tooltip label{ #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/[Colorful] Rainbow Spectrum.css b/config/waybar/style/[Colorful] Rainbow Spectrum.css index 333f798..8caa5cb 100644 --- a/config/waybar/style/[Colorful] Rainbow Spectrum.css +++ b/config/waybar/style/[Colorful] Rainbow Spectrum.css @@ -52,7 +52,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -138,6 +137,10 @@ tooltip label{ background-color: #a6e3a1; } +#mpris { + background-color: #fab387; + color: black; +} #custom-keyboard, #keyboard-state, #keyboard-state label, diff --git a/config/waybar/style/[Dark] Golden Noir.css b/config/waybar/style/[Dark] Golden Noir.css index 667b06e..75ba82b 100644 --- a/config/waybar/style/[Dark] Golden Noir.css +++ b/config/waybar/style/[Dark] Golden Noir.css @@ -123,7 +123,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -142,6 +141,7 @@ tooltip { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/[Dark] Obsidian Edge.css b/config/waybar/style/[Dark] Obsidian Edge.css index 8d21d72..be74c6b 100644 --- a/config/waybar/style/[Dark] Obsidian Edge.css +++ b/config/waybar/style/[Dark] Obsidian Edge.css @@ -116,7 +116,6 @@ tooltip label { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -135,6 +134,7 @@ tooltip label { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/[Light] Monochrome Contrast.css b/config/waybar/style/[Light] Monochrome Contrast.css index 34b579f..25ccf5c 100644 --- a/config/waybar/style/[Light] Monochrome Contrast.css +++ b/config/waybar/style/[Light] Monochrome Contrast.css @@ -110,7 +110,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Light] Obsidian Glow.css b/config/waybar/style/[Light] Obsidian Glow.css index cd939b5..f95daa0 100644 --- a/config/waybar/style/[Light] Obsidian Glow.css +++ b/config/waybar/style/[Light] Obsidian Glow.css @@ -85,7 +85,6 @@ tooltip label { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -104,6 +103,7 @@ tooltip label { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/[Pywal] Chroma Edge.css b/config/waybar/style/[Pywal] Chroma Edge.css index 282057c..ba4e83a 100644 --- a/config/waybar/style/[Pywal] Chroma Edge.css +++ b/config/waybar/style/[Pywal] Chroma Edge.css @@ -90,7 +90,6 @@ tooltip label{ #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Pywal] Chroma Fusion.css b/config/waybar/style/[Pywal] Chroma Fusion.css index 3f15037..b100639 100644 --- a/config/waybar/style/[Pywal] Chroma Fusion.css +++ b/config/waybar/style/[Pywal] Chroma Fusion.css @@ -50,7 +50,6 @@ window#waybar.empty #window { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -143,6 +142,10 @@ window#waybar.empty #window { color: @lavender; } +#custom-cava_mviz { + color: @color2; +} + #custom-lock, #idle_inhibitor { color: @teal; diff --git a/config/waybar/style/[Pywal] Chroma Tally.css b/config/waybar/style/[Pywal] Chroma Tally.css index c3a38fb..ace2ea3 100644 --- a/config/waybar/style/[Pywal] Chroma Tally.css +++ b/config/waybar/style/[Pywal] Chroma Tally.css @@ -55,7 +55,6 @@ window#waybar { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -203,11 +202,15 @@ window#waybar { #custom-lock, #bluetooth{ - color:#d08770; + color:#d08770; } - + +#custom-cava_mviz{ + color: @color2; +} + #custom-weather{ - color:#d08770; + color:#d08770; } #taskbar button.active { diff --git a/config/waybar/style/[Pywal] Colored.css b/config/waybar/style/[Pywal] Colored.css index afb0128..aeccffb 100644 --- a/config/waybar/style/[Pywal] Colored.css +++ b/config/waybar/style/[Pywal] Colored.css @@ -117,7 +117,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -136,6 +135,7 @@ tooltip { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, @@ -236,4 +236,8 @@ tooltip { #backlight-slider highlight { min-width: 10px; border-radius: 5px; +} + +#custom-cava_mviz { + padding-right: 10px; } \ No newline at end of file diff --git a/config/waybar/style/[Pywal] Simple.css b/config/waybar/style/[Pywal] Simple.css index 6acef45..138e926 100644 --- a/config/waybar/style/[Pywal] Simple.css +++ b/config/waybar/style/[Pywal] Simple.css @@ -104,7 +104,6 @@ tooltip { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, @@ -124,6 +123,7 @@ tooltip { #wireplumber, #workspaces, #custom-backlight, +#custom-cava_mviz, #custom-cycle_wall, #custom-keybinds, #custom-keyboard, diff --git a/config/waybar/style/[Retro] Simple Style.css b/config/waybar/style/[Retro] Simple Style.css index aaf14d6..ea13145 100644 --- a/config/waybar/style/[Retro] Simple Style.css +++ b/config/waybar/style/[Retro] Simple Style.css @@ -47,7 +47,6 @@ window#waybar { #backlight-slider, #battery, #bluetooth, -#cava, #clock, #cpu, #disk, diff --git a/config/waybar/style/[Transparent] Crystal Clear.css b/config/waybar/style/[Transparent] Crystal Clear.css index 3f64235..0f9b176 100644 --- a/config/waybar/style/[Transparent] Crystal Clear.css +++ b/config/waybar/style/[Transparent] Crystal Clear.css @@ -97,7 +97,6 @@ tooltip { #backlight, #battery, #bluetooth, -#cava, #clock, #cpu, #disk,