Browse Source

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
pull/112/head
Ja.KooLit 2 years ago
parent
commit
8e4bdc65ca
  1. 29
      config/hypr/scripts/WaybarCava.sh
  2. 59
      config/hypr/scripts/waybar_cava.sh
  3. 2
      config/waybar/configs/[BOT] Default
  4. 2
      config/waybar/configs/[BOT] Default Laptop
  5. 4
      config/waybar/configs/[TOP] Default
  6. 2
      config/waybar/configs/[TOP] Default Laptop
  7. 62
      config/waybar/modules
  8. 68
      config/waybar/style/Catppuccin-Latte.css
  9. 5
      config/waybar/style/Catppuccin-Mocha.css
  10. 1
      config/waybar/style/Crimson.css
  11. 2
      config/waybar/style/Purpl.css
  12. 3
      config/waybar/style/Rose Pine.css
  13. 2
      config/waybar/style/Simple Pink.css
  14. 1
      config/waybar/style/[Black & White] Monochrome.css
  15. 4
      config/waybar/style/[Bordered Pywal] Chroma Fusion Edge.css
  16. 1
      config/waybar/style/[Colored] Chroma Glow.css
  17. 1
      config/waybar/style/[Colored] Translucent.css
  18. 1
      config/waybar/style/[Colorful] Aurora Blossom.css
  19. 2
      config/waybar/style/[Colorful] Aurora.css
  20. 5
      config/waybar/style/[Colorful] Rainbow Spectrum.css
  21. 2
      config/waybar/style/[Dark] Golden Noir.css
  22. 2
      config/waybar/style/[Dark] Obsidian Edge.css
  23. 1
      config/waybar/style/[Light] Monochrome Contrast.css
  24. 2
      config/waybar/style/[Light] Obsidian Glow.css
  25. 1
      config/waybar/style/[Pywal] Chroma Edge.css
  26. 5
      config/waybar/style/[Pywal] Chroma Fusion.css
  27. 11
      config/waybar/style/[Pywal] Chroma Tally.css
  28. 6
      config/waybar/style/[Pywal] Colored.css
  29. 2
      config/waybar/style/[Pywal] Simple.css
  30. 1
      config/waybar/style/[Retro] Simple Style.css
  31. 1
      config/waybar/style/[Transparent] Crystal Clear.css

29
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" <<EOF
[general]
bars = 10
[output]
method = raw
raw_target = /dev/stdout
data_format = ascii
ascii_max_range = 7
EOF
# Read stdout from cava and perform substitution in a single sed command
cava -p "$config_file" | sed -u "$dict"

59
config/hypr/scripts/waybar_cava.sh

@ -1,59 +0,0 @@
# #! /bin/bash
# --------------------Smooth bars animation with 1-2% increase in CPU usage -------------------
# bar="▁▂▃▄▅▆▇█"
# dict="s/;//g;"
# # creating "dictionary" to replace char with bar
# i=0
# while [ $i -lt ${#bar} ]
# do
# dict="${dict}s/$i/${bar:$i:1}/g;"
# i=$((i=i+1))
# done
# # write cava config
# config_file="/tmp/polybar_cava_config"
# echo "
# [general]
# bars = 10
# [output]
# method = raw
# raw_target = /dev/stdout
# data_format = ascii
# ascii_max_range = 7
# " > $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" <<EOF
[general]
bars = 10
[output]
method = raw
raw_target = /dev/stdout
data_format = ascii
ascii_max_range = 7
EOF
# Read stdout from cava and perform substitution in a single sed command
cava -p "$config_file" | sed -u "$dict"

2
config/waybar/configs/[BOT] Default

@ -25,6 +25,8 @@
"memory", "memory",
"custom/separator#dot-line", "custom/separator#dot-line",
"custom/weather", "custom/weather",
"custom/separator#blank_3",
"custom/cava_mviz",
], ],
"modules-center": [ "modules-center": [

2
config/waybar/configs/[BOT] Default Laptop

@ -25,6 +25,8 @@
"memory", "memory",
"custom/separator#dot-line", "custom/separator#dot-line",
"custom/weather", "custom/weather",
"custom/separator#blank_3",
"custom/cava_mviz",
], ],
"modules-center": [ "modules-center": [

4
config/waybar/configs/[TOP] Default

@ -25,8 +25,8 @@
"memory", "memory",
"custom/separator#dot-line", "custom/separator#dot-line",
"custom/weather", "custom/weather",
"custom/separator#dot-line", "custom/separator#blank_3",
"custom/mviz", "custom/cava_mviz",
], ],
"modules-center": [ "modules-center": [

2
config/waybar/configs/[TOP] Default Laptop

@ -25,6 +25,8 @@
"memory", "memory",
"custom/separator#dot-line", "custom/separator#dot-line",
"custom/weather", "custom/weather",
"custom/separator#blank_3",
"custom/cava_mviz",
], ],
"modules-center": [ "modules-center": [

62
config/waybar/modules

@ -215,30 +215,7 @@
"tooltip": true, "tooltip": true,
"on-click": "blueman-manager", "on-click": "blueman-manager",
}, },
"cava": {
//"cava_config": "$XDG_CONFIG_HOME/cava/cava.conf",
"framerate": 30,
"autosens": 1,
"sensitivity": 100,
"bars": 14,
"lower_cutoff_freq": 50,
"higher_cutoff_freq": 10000,
"method": "pulse",
"source": "auto",
"stereo": true,
"reverse": false,
"bar_delimiter": 0,
"monstercat": false,
"waves": false,
"noise_reduction": 0.77,
"input_delay": 2,
"format-icons" : ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" ],
"actions": {
"on-click-right": "mode"
}
},
"clock": { "clock": {
"interval": 1, "interval": 1,
//"format": " {:%I:%M %p}", // AM PM format //"format": " {:%I:%M %p}", // AM PM format
@ -530,6 +507,12 @@
"on-click-middle": "~/.config/hypr/scripts/WallpaperSelect.sh", "on-click-middle": "~/.config/hypr/scripts/WallpaperSelect.sh",
"on-click-right": "~/.config/hypr/scripts/WaybarLayout.sh", "on-click-right": "~/.config/hypr/scripts/WaybarLayout.sh",
}, },
// This is a custom cava visualizer
"custom/cava_mviz": {
"exec": "~/.config/hypr/scripts/WaybarCava.sh",
"format": "{}"
},
"custom/playerctl": { "custom/playerctl": {
"format": "<span>{}</span>", "format": "<span>{}</span>",
@ -545,6 +528,15 @@
"smooth-scrolling-threshold": 1, "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": { "custom/swaync": {
"tooltip":true, "tooltip":true,
"format": "{icon} {}", "format": "{icon} {}",
@ -565,21 +557,7 @@
"on-click-right": "swaync-client -d -sw", "on-click-right": "swaync-client -d -sw",
"escape": true, "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 // NOTE:! This is only for Arch and Arch Based Distros
"custom/updater":{ "custom/updater":{
"format": " {}", "format": " {}",
@ -632,6 +610,12 @@
"interval": "once", "interval": "once",
"tooltip": false "tooltip": false
}, },
"custom/separator#blank_3": {
"format": " ",
"interval": "once",
"tooltip": false
},
// Modules below are for vertical layout // Modules below are for vertical layout

68
config/waybar/style/Catppuccin-Latte.css

@ -48,7 +48,6 @@ window#waybar.hidden {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -96,15 +95,15 @@ window#waybar.hidden {
} }
#idle_inhibitor { #idle_inhibitor {
color: @blue; color: @blue;
} }
#backlight { #backlight {
color: @blue; color: @blue;
} }
#battery { #battery {
color: @green; color: @green;
} }
@keyframes blink { @keyframes blink {
@ -114,14 +113,14 @@ window#waybar.hidden {
} }
#battery.critical:not(.charging) { #battery.critical:not(.charging) {
background-color: @red; background-color: @red;
color: @theme_text_color; color: @theme_text_color;
animation-name: blink; animation-name: blink;
animation-duration: 0.5s; animation-duration: 0.5s;
animation-timing-function: linear; animation-timing-function: linear;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-direction: alternate; animation-direction: alternate;
box-shadow: inset 0 -3px transparent; box-shadow: inset 0 -3px transparent;
} }
#bluetooth { #bluetooth {
@ -129,28 +128,28 @@ window#waybar.hidden {
} }
#clock { #clock {
color: @yellow; color: @yellow;
} }
#cpu { #cpu {
color: @green; color: @green;
} }
#custom-keyboard, #custom-keyboard,
#memory { #memory {
color: @sky; color: @sky;
} }
#disk { #disk {
color: @sapphire; color: @sapphire;
} }
#temperature { #temperature {
color: @teal; color: @teal;
} }
#temperature.critical { #temperature.critical {
background-color: @red; background-color: @red;
} }
#tray > .passive { #tray > .passive {
@ -161,7 +160,7 @@ window#waybar.hidden {
} }
#keyboard-state { #keyboard-state {
color: @flamingo; color: @flamingo;
} }
#workspaces button { #workspaces button {
@ -217,57 +216,60 @@ window#waybar.hidden {
animation: gradient_f 20s ease-in infinite; animation: gradient_f 20s ease-in infinite;
transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682);
} }
#custom-cava_mviz {
color: @pink;
}
#custom-menu { #custom-menu {
color: @rosewater; color: @rosewater;
} }
#custom-power { #custom-power {
color: @red; color: @red;
} }
#custom-updater { #custom-updater {
color: @red; color: @red;
} }
#custom-light_dark { #custom-light_dark {
color: @blue; color: @blue;
} }
#custom-weather { #custom-weather {
color: @lavender; color: @lavender;
} }
#custom-lock { #custom-lock {
color: @maroon; color: @maroon;
} }
#pulseaudio { #pulseaudio {
color: @sapphire; color: @sapphire;
} }
#pulseaudio.bluetooth { #pulseaudio.bluetooth {
color: @pink; color: @pink;
} }
#pulseaudio.muted { #pulseaudio.muted {
color: @red; color: @red;
} }
#window { #window {
color: @mauve; color: @mauve;
} }
#custom-waybar-mpris { #custom-waybar-mpris {
color:@lavender; color:@lavender;
} }
#network { #network {
color: @teal; color: @teal;
} }
#network.disconnected, #network.disconnected,
#network.disabled { #network.disabled {
background-color: @surface0; background-color: @surface0;
color: @text; color: @text;
} }
#pulseaudio-slider slider { #pulseaudio-slider slider {
min-width: 0px; min-width: 0px;

5
config/waybar/style/Catppuccin-Mocha.css

@ -54,7 +54,6 @@ window#waybar.hidden {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -221,6 +220,10 @@ window#waybar.hidden {
transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682); transition: all 0.3s cubic-bezier(.55,-0.68,.48,1.682);
} }
#custom-cava_mviz {
color: @pink;
}
#custom-menu { #custom-menu {
color: @rosewater; color: @rosewater;
} }

1
config/waybar/style/Crimson.css

@ -110,7 +110,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

2
config/waybar/style/Purpl.css

@ -120,7 +120,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -139,6 +138,7 @@ tooltip {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

3
config/waybar/style/Rose Pine.css

@ -101,7 +101,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -129,7 +128,7 @@ tooltip {
#custom-swaync, #custom-swaync,
#custom-updater, #custom-updater,
#custom-swaync, #custom-swaync,
#custom-mviz, #custom-cava_mviz,
#custom-weather, #custom-weather,
#custom-weather.clearNight, #custom-weather.clearNight,
#custom-weather.cloudyFoggyDay, #custom-weather.cloudyFoggyDay,

2
config/waybar/style/Simple Pink.css

@ -124,7 +124,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -144,6 +143,7 @@ tooltip {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

1
config/waybar/style/[Black & White] Monochrome.css

@ -109,7 +109,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

4
config/waybar/style/[Bordered Pywal] Chroma Fusion Edge.css

@ -51,7 +51,6 @@ window#waybar.empty #window {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -150,6 +149,9 @@ window#waybar.empty #window {
color: @teal; color: @teal;
} }
#custom-cava_mviz{
color: @color2;
}
#workspaces { #workspaces {
margin: 1px 1px 1px 1px; margin: 1px 1px 1px 1px;
padding: 0px 1px; padding: 0px 1px;

1
config/waybar/style/[Colored] Chroma Glow.css

@ -97,7 +97,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

1
config/waybar/style/[Colored] Translucent.css

@ -111,7 +111,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

1
config/waybar/style/[Colorful] Aurora Blossom.css

@ -97,7 +97,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

2
config/waybar/style/[Colorful] Aurora.css

@ -88,7 +88,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -107,6 +106,7 @@ tooltip label{
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

5
config/waybar/style/[Colorful] Rainbow Spectrum.css

@ -52,7 +52,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -138,6 +137,10 @@ tooltip label{
background-color: #a6e3a1; background-color: #a6e3a1;
} }
#mpris {
background-color: #fab387;
color: black;
}
#custom-keyboard, #custom-keyboard,
#keyboard-state, #keyboard-state,
#keyboard-state label, #keyboard-state label,

2
config/waybar/style/[Dark] Golden Noir.css

@ -123,7 +123,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -142,6 +141,7 @@ tooltip {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

2
config/waybar/style/[Dark] Obsidian Edge.css

@ -116,7 +116,6 @@ tooltip label {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -135,6 +134,7 @@ tooltip label {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

1
config/waybar/style/[Light] Monochrome Contrast.css

@ -110,7 +110,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

2
config/waybar/style/[Light] Obsidian Glow.css

@ -85,7 +85,6 @@ tooltip label {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -104,6 +103,7 @@ tooltip label {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

1
config/waybar/style/[Pywal] Chroma Edge.css

@ -90,7 +90,6 @@ tooltip label{
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

5
config/waybar/style/[Pywal] Chroma Fusion.css

@ -50,7 +50,6 @@ window#waybar.empty #window {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -143,6 +142,10 @@ window#waybar.empty #window {
color: @lavender; color: @lavender;
} }
#custom-cava_mviz {
color: @color2;
}
#custom-lock, #custom-lock,
#idle_inhibitor { #idle_inhibitor {
color: @teal; color: @teal;

11
config/waybar/style/[Pywal] Chroma Tally.css

@ -55,7 +55,6 @@ window#waybar {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -203,11 +202,15 @@ window#waybar {
#custom-lock, #custom-lock,
#bluetooth{ #bluetooth{
color:#d08770; color:#d08770;
} }
#custom-cava_mviz{
color: @color2;
}
#custom-weather{ #custom-weather{
color:#d08770; color:#d08770;
} }
#taskbar button.active { #taskbar button.active {

6
config/waybar/style/[Pywal] Colored.css

@ -117,7 +117,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -136,6 +135,7 @@ tooltip {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,
@ -236,4 +236,8 @@ tooltip {
#backlight-slider highlight { #backlight-slider highlight {
min-width: 10px; min-width: 10px;
border-radius: 5px; border-radius: 5px;
}
#custom-cava_mviz {
padding-right: 10px;
} }

2
config/waybar/style/[Pywal] Simple.css

@ -104,7 +104,6 @@ tooltip {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,
@ -124,6 +123,7 @@ tooltip {
#wireplumber, #wireplumber,
#workspaces, #workspaces,
#custom-backlight, #custom-backlight,
#custom-cava_mviz,
#custom-cycle_wall, #custom-cycle_wall,
#custom-keybinds, #custom-keybinds,
#custom-keyboard, #custom-keyboard,

1
config/waybar/style/[Retro] Simple Style.css

@ -47,7 +47,6 @@ window#waybar {
#backlight-slider, #backlight-slider,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

1
config/waybar/style/[Transparent] Crystal Clear.css

@ -97,7 +97,6 @@ tooltip {
#backlight, #backlight,
#battery, #battery,
#bluetooth, #bluetooth,
#cava,
#clock, #clock,
#cpu, #cpu,
#disk, #disk,

Loading…
Cancel
Save