aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/WaybarCava.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/hypr/scripts/WaybarCava.sh')
-rwxr-xr-xconfig/hypr/scripts/WaybarCava.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/hypr/scripts/WaybarCava.sh b/config/hypr/scripts/WaybarCava.sh
new file mode 100755
index 00000000..458a31bb
--- /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" <<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"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage