aboutsummaryrefslogtreecommitdiff
path: root/dwmbar
diff options
context:
space:
mode:
authorArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-23 15:04:02 +0100
committerArchie Hilton (thytom) <archie.hilton1@gmail.com>2019-10-23 15:04:02 +0100
commit9e41bf1bc6935af7ba407d88166023ca70225d54 (patch)
tree9e7a37707cd45acdc35f31683cab57b8d4b96b5b /dwmbar
parentf5fbbb7572a685c695515d23969fbfaf7b4d011f (diff)
Made dwmbar only copy files when explicitly told.
Diffstat (limited to 'dwmbar')
-rwxr-xr-xdwmbar18
1 files changed, 14 insertions, 4 deletions
diff --git a/dwmbar b/dwmbar
index 00e4aa9..84582af 100755
--- a/dwmbar
+++ b/dwmbar
@@ -1,5 +1,5 @@
#!/bin/bash
-VERSION="0.0.1"
+VERSION="0.1"
RC_LOCATION="/home/$USER/.config/dwmbar/dwmbarrc"
CONFIG_DIR="/home/$USER/.config/dwmbar"
@@ -9,10 +9,13 @@ DWMBARRC="$CONFIG_DIR/dwmbarrc"
CACHE_DIR="$CONFIG_DIR/.cache"
print_help(){
- echo "dwmbar $VERSION"
+ echo "dwmbar $VERSION
+-v Display this help message.
+-c Copy default files to /home/$USER/.config/dwmbar
+"
}
-install_files(){
+copy_usr_to_home(){
[[ ! -d $CONFIG_DIR ]] && cp -r /usr/share/dwmbar $CONFIG_DIR
[[ ! -f $DWMBARRC ]] && cp /usr/share/dwmbar/dwmbarrc $DWMBARRC
[[ ! -d $MODULES_DIR ]] && cp /usr/share/dwmbar/modules $MODULES_DIR
@@ -20,7 +23,14 @@ install_files(){
[[ ! -d $CACHE_DIR ]] && mkdir $CACHE_DIR
}
-install_files
+while getopts 'v' flag; do
+ case "${flag}" in
+ v) print_help
+ exit 0 ;;
+ c) copy_usr_to_home
+ exit 0 ;;
+ esac
+done
while :; do
xsetroot -name "$(exec $RC_LOCATION)"