aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-21 22:57:45 +0100
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-21 22:57:45 +0100
commit63399b33197214c10f2477ee400f2546edda920c (patch)
treea5dde146d55576f1d55a524a0b1a3d8e406bf80e
parenta37c7b0f4e4d839a20dc95b21063437de8ea83ee (diff)
Added custom modules directory.
Scripts in here override the system ones, and won't get written over during updates.
-rw-r--r--TODO.org6
-rwxr-xr-xdwmbarrc7
-rwxr-xr-xinstall.sh16
3 files changed, 17 insertions, 12 deletions
diff --git a/TODO.org b/TODO.org
index 218752f..9b7ff0f 100644
--- a/TODO.org
+++ b/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.
diff --git a/dwmbarrc b/dwmbarrc
index a1039e8..20a5a0f 100755
--- a/dwmbarrc
+++ b/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"
- OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)"
+ if [[ -f "$CUSTOM_DIR$module" ]]; then
+ OUTPUT="$OUTPUT$(exec $CUSTOM_DIR$module)"
+ elif
+ OUTPUT="$OUTPUT$(exec $MODULES_DIR$module)"
+ fi
done
}
diff --git a/install.sh b/install.sh
index 40d8170..7be1a26 100755
--- a/install.sh
+++ b/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"
+cp "./dwmbar" "/usr/bin/dwmbar"
- mkdir -p "$CONFIG_DIR"
+mkdir -p "$CUSTOM_DIR"
- [[ ! -f "$MODULES_DIR" ]] && cp -r "./modules" "$CONFIG_DIR/modules"
- [[ ! -f "$DWMBARRC" ]] && cp "./dwmbarrc" "$DWMBARRC"
-}
+for script in $(ls modules); do
+ echo "modules/$script -> $MODULES_DIR/$script"
+ cp "modules/$script" "$MODULES_DIR/$script"
+done
-install
+[[ ! -f "$DWMBARRC" ]] && cp "./dwmbarrc" "$DWMBARRC"