Files
Eww_Widgets/widgets/control/control-panel
T
2023-04-24 15:41:27 +05:45

29 lines
661 B
Bash
Executable File

#!/bin/bash
[ ! -d $cache_dir ] && mkdir $cache_dir
cache_dir="$HOME/.cache/eww"
cache="$cache_dir/control-center.eww"
config="$HOME/.config/polybar/widgets/control"
active_players=$(playerctl -l | head -n 1)
run () {
eww -c $config open control-panel
eww -c $config update control-panel=true
[[ ! -z $active_players ]] && eww -c $config update music-panel=true
}
if [[ ! `pidof eww` ]]; then
eww -c $config daemon
else
if [ ! -f $cache ]; then
touch $cache
run
else
[[ ! -z $active_players ]] && eww -c $config update music-panel=false
eww -c $config update control-panel=false
eww -c $config close control-panel
rm $cache
fi
fi