diff options
| author | iamcheeseman <[email protected]> | 2026-05-10 18:36:22 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-10 18:36:22 -0400 |
| commit | 8e5173a2d25c8f79607f4806016276065abda41c (patch) | |
| tree | be4cfd1d2c7589d85b44f55ea8a966cb3bf3d776 /.local | |
| parent | f0bf896d1372c69d8ad7889564a28168954d8123 (diff) | |
update
Diffstat (limited to '.local')
| -rwxr-xr-x | .local/bin/audio_vis.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/.local/bin/audio_vis.sh b/.local/bin/audio_vis.sh new file mode 100755 index 0000000..62bb76c --- /dev/null +++ b/.local/bin/audio_vis.sh @@ -0,0 +1,31 @@ +#! /bin/bash + +# bar='_▁▂▃▄▅▆▇█#' +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 = 12 + +[output] +method = raw +raw_target = /dev/stdout +data_format = ascii +ascii_max_range = 6 +" > $config_file + +# read stdout from cava +cava -p $config_file | while read -r line; do + echo $line | sed $dict +done |
