diff --git a/bar.sh b/bar.sh index 44c4ec0..f9866f4 100755 --- a/bar.sh +++ b/bar.sh @@ -16,13 +16,14 @@ # along with this program. If not, see . -CONFIG_FILE="/home/$USER/.config/dwmbar/config" - -source $CONFIG_FILE +MODULES_DIR="/usr/share/dwmbar/modules/" OUTPUT_CACHE="/home/$USER/.config/dwmbar/.cache/" OUTPUT="" +CONFIG_FILE="/home/$USER/.config/dwmbar/config" +source $CONFIG_FILE + INTERNET=1 #0 being true get_internet() diff --git a/config b/config index 503b487..c53aaeb 100644 --- a/config +++ b/config @@ -1,7 +1,5 @@ #!/bin/bash -MODULES_DIR="/home/$USER/.config/dwmbar/modules/" - # What modules, in what order MODULES="mpd weather volumebar wifi internet cpuload temperature date time" diff --git a/dwmbar b/dwmbar index f0514c7..2536d13 100755 --- a/dwmbar +++ b/dwmbar @@ -19,14 +19,11 @@ VERSION="0.1" DEFAULT_CONFIG_DIR="/usr/share/dwmbar" DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules" -DEFAULT_RC_LOCATION="$DEFAULT_CONFIG_DIR/bar.sh" +DEFAULT_BAR_LOCATION="$DEFAULT_CONFIG_DIR/bar.sh" DEFAULT_CONFIG_LOCATION="$DEFAULT_CONFIG_DIR/config" -RC_LOCATION="/home/$USER/.config/dwmbar/bar.sh" CONFIG_DIR="/home/$USER/.config/dwmbar" -MODULES_DIR="$CONFIG_DIR/modules" -CUSTOM_DIR="$MODULES_DIR/custom" -DWMBARRC="$CONFIG_DIR/bar.sh" +CUSTOM_DIR="$CONFIG_DIR/custom" CONFIG_FILE="$CONFIG_DIR/config" CACHE_DIR="$CONFIG_DIR/.cache" @@ -39,9 +36,7 @@ print_help(){ copy_usr_to_home(){ [[ ! -d $CONFIG_DIR ]] && cp -r /usr/share/dwmbar $CONFIG_DIR - [[ ! -f $DWMBARRC ]] && cp /usr/share/dwmbar/bar.sh $DWMBARRC [[ ! -f $CONFIG_FILE ]] && cp /usr/share/dwmbar/config $CONFIG_FILE - [[ ! -d $MODULES_DIR ]] && cp /usr/share/dwmbar/modules $MODULES_DIR [[ ! -d $CUSTOM_DIR ]] && mkdir $CUSTOM_DIR [[ ! -d $CACHE_DIR ]] && mkdir $CACHE_DIR } @@ -57,8 +52,8 @@ check_files(){ exit 1 fi - if [[ ! -f $DEFAULT_RC_LOCATION ]]; then - echo "$DEFAULT_RC_LOCATION does not exist." > /dev/stderr + if [[ ! -f $DEFAULT_BAR_LOCATION ]]; then + echo "$DEFAULT_BAR_LOCATION does not exist." > /dev/stderr exit 1 fi @@ -80,5 +75,5 @@ done check_files while :; do - xsetroot -name "$(exec $RC_LOCATION)" + xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)" done diff --git a/install.sh b/install.sh index 715c989..c409bd2 100755 --- a/install.sh +++ b/install.sh @@ -32,8 +32,13 @@ fi mkdir --parents "/usr/share/dwmbar/" +echo "./modules --> /usr/share/dwmbar/modules" cp -r "./modules" "/usr/share/dwmbar/modules" -cp -r "./bar.sh" "/usr/share/dwmbar/bar.sh" + +echo "./bar.sh --> /usr/share/dwmbar/bar.sh" +cp "./bar.sh" "/usr/share/dwmbar/bar.sh" + +echo "./config --> /usr/share/dwmbar/config" cp -r "./config" "/usr/share/dwmbar/config" echo "./dwmbar --> /usr/bin/dwmbar"