mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-09 22:19:45 +00:00
Added custom modules directory.
Scripts in here override the system ones, and won't get written over during updates.
This commit is contained in:
parent
a37c7b0f4e
commit
63399b3319
3 changed files with 17 additions and 12 deletions
6
TODO.org
6
TODO.org
|
@ -17,10 +17,10 @@ Modules:
|
|||
- Mail
|
||||
- CPU Usage
|
||||
- Volume Bar (archie)
|
||||
- Backlight
|
||||
- Memory Usage
|
||||
|
||||
Finished Modules:
|
||||
- Backlight
|
||||
- Network
|
||||
- Volume
|
||||
- Battery
|
||||
|
@ -31,6 +31,6 @@ Finished Modules:
|
|||
- Time
|
||||
- Date
|
||||
|
||||
Scripts
|
||||
Scripts:
|
||||
- Individual module delays.
|
||||
- Modules that don't output anything shouldn't get a separator.
|
||||
- Make install script install locally and not for root.
|
||||
|
|
5
dwmbarrc
5
dwmbarrc
|
@ -4,6 +4,7 @@
|
|||
|
||||
DELAY=5
|
||||
MODULES_DIR="modules/"
|
||||
CUSTOM_DIR="modules/custom/"
|
||||
SEPARATOR=" | "
|
||||
|
||||
MODULES="wifi internet bluetooth volume temperature date time battery"
|
||||
|
@ -11,7 +12,11 @@ MODULES="wifi internet bluetooth volume temperature date time battery"
|
|||
run_modules(){
|
||||
for module in $MODULES; do
|
||||
[[ ! "$OUTPUT" = "" ]] && OUTPUT="$OUTPUT$SEPARATOR"
|
||||
if [[ -f "$CUSTOM_DIR$module" ]]; then
|
||||
OUTPUT="$OUTPUT$(exec $CUSTOM_DIR$module)"
|
||||
elif
|
||||
OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
|
14
install.sh
14
install.sh
|
@ -2,6 +2,7 @@
|
|||
|
||||
CONFIG_DIR="/home/$USER/.config/dwmbar"
|
||||
MODULES_DIR="$CONFIG_DIR/modules"
|
||||
CUSTOM_DIR="$MODULES_DIR/custom"
|
||||
DWMBARRC="$CONFIG_DIR/dwmbarrc"
|
||||
DWMBAR="/usr/bin/dwmbar"
|
||||
|
||||
|
@ -9,14 +10,13 @@ if [[ ! -f "dwmbar" ]]; then
|
|||
echo "dwmbar executable not found."
|
||||
fi
|
||||
|
||||
install()
|
||||
{
|
||||
cp "./dwmbar" "/usr/bin/dwmbar"
|
||||
|
||||
mkdir -p "$CONFIG_DIR"
|
||||
mkdir -p "$CUSTOM_DIR"
|
||||
|
||||
for script in $(ls modules); do
|
||||
echo "modules/$script -> $MODULES_DIR/$script"
|
||||
cp "modules/$script" "$MODULES_DIR/$script"
|
||||
done
|
||||
|
||||
[[ ! -f "$MODULES_DIR" ]] && cp -r "./modules" "$CONFIG_DIR/modules"
|
||||
[[ ! -f "$DWMBARRC" ]] && cp "./dwmbarrc" "$DWMBARRC"
|
||||
}
|
||||
|
||||
install
|
||||
|
|
Loading…
Reference in a new issue