Added padding functionality and option to remove last separator.

This commit is contained in:
Archie Hilton (thytom) 2019-10-22 21:50:28 +01:00
parent a1641c8d09
commit 8ba6ac420c

View file

@ -6,7 +6,7 @@ DELAY=0.05
MODULES_DIR="/home/$USER/.config/dwmbar/modules/" MODULES_DIR="/home/$USER/.config/dwmbar/modules/"
CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/" CUSTOM_DIR="/home/$USER/.config/dwmbar/modules/custom/"
SEPARATOR=" | " SEPARATOR=" | "
PADDING=" " PADDING="$USER@$HOSTNAME "
OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/" OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/"
OUTPUT="" OUTPUT=""
@ -18,7 +18,9 @@ get_bar(){
module_out=$(cat $OUTPUT_CACHE$module | sed 's/\.$//g') module_out=$(cat $OUTPUT_CACHE$module | sed 's/\.$//g')
bar=$bar$module_out bar=$bar$module_out
done done
echo $bar | sed 's/.$//g' # Uncomment to remove last separator
# bar=$(echo $bar | sed 's/.$//g')
echo "$bar$PADDING"
} }
run_module(){ run_module(){