diff --git a/dwmbar b/dwmbar index ba0de22..f896e0d 100755 --- a/dwmbar +++ b/dwmbar @@ -15,7 +15,7 @@ VERSION="1.0" -DEFAULT_CONFIG_DIR="/usr/share/dwmbar" +DEFAULT_CONFIG_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/_dwmbar" export DEFAULT_CONFIG_DIR DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules/" export DEFAULT_MODULES_DIR @@ -51,7 +51,8 @@ print_help(){ copy_usr_to_home(){ mkdir -p "$CUSTOM_DIR" - cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR" + #cp -r "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR" + install "$DEFAULT_CONFIG_LOCATION" "$CONFIG_DIR" -m 744 } check_files(){ @@ -98,6 +99,11 @@ check_internet() { fi } +if [[ ! -d "$CONFIG_DIR" ]]; then + echo "INSTALLING COZ CONFIG DONT EXISTS" + copy_usr_to_home +fi + check_files while :; do diff --git a/install.sh b/install.sh index c409bd2..26159ba 100755 --- a/install.sh +++ b/install.sh @@ -15,12 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -DWMBAR="/usr/bin/dwmbar" - -if [ "$EUID" -ne 0 ] - then echo "Please run as root" > /dev/stderr - exit 1 -fi +INSTALL_LOCATION="$1/share" +BIN_LOCATION="$1/bin" if [[ ! -f "dwmbar" ]]; then echo "dwmbar executable not found." > /dev/stderr @@ -30,17 +26,17 @@ fi # Create /usr/share/dwmbar # Containing example bar.sh and modules -mkdir --parents "/usr/share/dwmbar/" +mkdir --parents "$INSTALL_LOCATION/dwmbar/" -echo "./modules --> /usr/share/dwmbar/modules" -cp -r "./modules" "/usr/share/dwmbar/modules" +echo "./modules --> $INSTALL_LOCATION/dwmbar/modules" +cp -r "./modules" "$INSTALL_LOCATION/dwmbar/modules" -echo "./bar.sh --> /usr/share/dwmbar/bar.sh" -cp "./bar.sh" "/usr/share/dwmbar/bar.sh" +echo "./bar.sh --> $INSTALL_LOCATION/dwmbar/bar.sh" +cp "./bar.sh" "$INSTALL_LOCATION/dwmbar/bar.sh" -echo "./config --> /usr/share/dwmbar/config" -cp -r "./config" "/usr/share/dwmbar/config" +echo "./config --> $INSTALL_LOCATION/dwmbar/config" +cp -r "./config" "$INSTALL_LOCATION/dwmbar/config" -echo "./dwmbar --> /usr/bin/dwmbar" -cp "./dwmbar" "/usr/bin/dwmbar" +echo "./dwmbar --> $BIN_LOCATION/dwmbar" +cp "./dwmbar" "$BIN_LOCATION/dwmbar" [[ $? -eq 0 ]] && echo "Installation completed successfully" diff --git a/modules/internet b/modules/internet index 22cbd6a..0b17df1 100755 Binary files a/modules/internet and b/modules/internet differ