Changes in: waybar,

This commit is contained in:
Gopher 2025-03-20 16:18:42 +05:30
parent 9872af2f32
commit 9920450b17
3 changed files with 36 additions and 35 deletions

View file

@ -18,6 +18,10 @@
// "bluetooth", // "bluetooth",
"battery" "battery"
], ],
"custom/cava": {
"format": "{}",
"exec": "~/.config/waybar/scripts/cava.sh"
},
"temperature#gpu": { "temperature#gpu": {
"thermal-zone": 5, "thermal-zone": 5,
"critical-threshold": 80, "critical-threshold": 80,
@ -25,30 +29,6 @@
"format": "{temperatureC}°C ", "format": "{temperatureC}°C ",
"tooltip": false "tooltip": false
}, },
"custom/cava": {
// "cava_config": "$XDG_CONFIG_HOME/.config/cava/config",
"framerate": 30,
"autosens": 1,
// "sensitivity": 100,
"bars": 14,
"lower_cutoff_freq": 50,
"higher_cutoff_freq": 10000,
"method": "pulse",
"exec": "~/.config/waybar/scripts/cava.sh",
"interval": 0.05,
"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"
}
},
"backlight": { "backlight": {
"device": "intel_backlight", "device": "intel_backlight",
"scroll-step": 5, "scroll-step": 5,

View file

@ -1,10 +1,30 @@
#! /bin/bash #! /bin/bash
is_cava_ServerExist=`ps -ef|grep -m 1 cava|grep -v "grep"|wc -l`
if [ "$is_cava_ServerExist" = "0" ]; then
echo "cava_server not found" > /dev/null 2>&1
# exit;
elif [ "$is_cava_ServerExist" = "1" ]; then
killall cava
fi
cava -p ~/.config/cava/config | sed -u 's/;//g;s/0/▁/g;s/1/▂/g;s/2/▃/g;s/3/▄/g;s/4/▅/g;s/5/▆/g;s/6/▇/g;s/7/█/g;' 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 = 6
[output]
method = raw
raw_target = /dev/stdout
data_format = ascii
ascii_max_range = 5
" > $config_file
# read stdout from cava
cava -p $config_file | while read -r line; do
echo $line | sed $dict
done

View file

@ -17,9 +17,10 @@
color: #8fbc8f; color: #8fbc8f;
border-left: 0px; border-left: 0px;
border-right: 0px; border-right: 0px;
padding-bottom: 6px; padding: 6px;
font-family: 'bargraph'; font-family: 'bargraph';
font-size: 22px; background: @raisin-black;
margin: 0px 2px;
} }
#cpu { #cpu {