dwmbar/dwmbarrc
Archie Hilton (thytom) a1641c8d09 Updates to dwmbarrc
Offline and Online modules will get added soon, but need to be
implemented differently.
2019-10-22 21:45:23 +01:00

44 lines
826 B
Bash
Executable file

#!/bin/bash
# Example file, designed to be edited.
DELAY=0.05
MODULES_DIR="/home/$USER/.config/dwmbar/modules/"
CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/"
SEPARATOR=" | "
PADDING=" "
OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
OUTPUT=""
MODULES="mpd volumebar wifi redshift disksize ram temperature date time battery"
get_bar(){
for module in $MODULES; do
module_out=$(cat $OUTPUT_CACHE$module | sed 's/\.$//g')
bar=$bar$module_out
done
echo $bar | sed 's/.$//g'
}
run_module(){
if [[ -f "$CUSTOM_DIR$1" ]]
then
out="$(exec $CUSTOM_DIR$1)"
else
out="$(exec $MODULES_DIR$1)"
fi
[[ ! "$out" = "" ]] && [[ ! "$module" = "NULL" ]] && out="$out$SEPARATOR."
echo $out > "$OUTPUT_CACHE$module"
}
run(){
for module in $MODULES; do
run_module $module
done
get_bar
sleep $DELAY;
}
run