mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-21 18:12:53 +00:00
33 lines
696 B
Bash
Executable file
33 lines
696 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Example file, designed to be edited.
|
|
|
|
DELAY=5
|
|
MODULES_DIR="/home/$USER/.config/dwmbar/modules/"
|
|
CUSTOM_DIR="$MODULES_DIR/custom/"
|
|
SEPARATOR=" | "
|
|
|
|
# Add and remove modules here
|
|
# Modules that dont require an internet conneciton
|
|
OFFLINE_MODULES="wifi internet bluetooth volume temperature date time battery"
|
|
# Modules that require an internet connection
|
|
ONLINE_MODULES=""
|
|
|
|
run_modules(){
|
|
for module in $MODULES; do
|
|
[[ ! "$OUTPUT" = "" ]] && OUTPUT="$OUTPUT$SEPARATOR"
|
|
if [[ -f "$CUSTOM_DIR$module" ]]; then
|
|
OUTPUT="$OUTPUT$(exec $CUSTOM_DIR$module)"
|
|
else
|
|
OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)"
|
|
fi
|
|
done
|
|
}
|
|
|
|
run(){
|
|
run_modules
|
|
echo $OUTPUT
|
|
sleep $DELAY;
|
|
}
|
|
|
|
run
|