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. 58
      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. 9
      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",
"custom/separator#dot-line",
"custom/weather",
"custom/separator#blank_3",
"custom/cava_mviz",
],
"modules-center": [

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

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

4
config/waybar/configs/[TOP] Default

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

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

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

58
config/waybar/modules

@ -216,29 +216,6 @@
"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": {
"interval": 1,
//"format": " {:%I:%M %p}", // AM PM format
@ -531,6 +508,12 @@
"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": {
"format": "<span>{}</span>",
"return-type": "json",
@ -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} {}",
@ -566,20 +558,6 @@
"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": " {}",
@ -633,6 +611,12 @@
"tooltip": false
},
"custom/separator#blank_3": {
"format": " ",
"interval": "once",
"tooltip": false
},
// Modules below are for vertical layout
"backlight#vertical": {

68
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;

5
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;
}

1
config/waybar/style/Crimson.css

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

2
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,

3
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,

2
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,

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

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

4
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;

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

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

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

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

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

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

2
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,

5
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,

2
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,

2
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,

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

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

2
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,

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

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

5
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;

9
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 {

6
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,
@ -237,3 +237,7 @@ tooltip {
min-width: 10px;
border-radius: 5px;
}
#custom-cava_mviz {
padding-right: 10px;
}

2
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,

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

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

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

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

Loading…
Cancel
Save