mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-12 15:19:44 +00:00
Made the install script actually work.
It installs dwmbar to /usr/bin and skeleton stuff to /usr/share/dwmbar
This commit is contained in:
parent
16ea007427
commit
6de7a8e0a7
2 changed files with 26 additions and 20 deletions
21
dwmbar
21
dwmbar
|
@ -2,17 +2,26 @@
|
||||||
VERSION="0.0.1"
|
VERSION="0.0.1"
|
||||||
|
|
||||||
RC_LOCATION="/home/$USER/.config/dwmbar/dwmbarrc"
|
RC_LOCATION="/home/$USER/.config/dwmbar/dwmbarrc"
|
||||||
|
CONFIG_DIR="/home/$USER/.config/dwmbar"
|
||||||
if [[ -f $DEFAULT_RC_LOCATION ]]; then
|
MODULES_DIR="$CONFIG_DIR/modules"
|
||||||
>&2 echo "No dwmbarrc found."
|
CUSTOM_DIR="$MODULES_DIR/custom"
|
||||||
exit 1
|
DWMBARRC="$CONFIG_DIR/dwmbarrc"
|
||||||
fi
|
CACHE_DIR="$CONFIG_DIR/.cache"
|
||||||
|
|
||||||
print_help(){
|
print_help(){
|
||||||
echo "dwmbar $VERSION"
|
echo "dwmbar $VERSION"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_files(){
|
||||||
|
[[ ! -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
|
||||||
|
[[ ! -d $CUSTOM_DIR ]] && mkdir $CUSTOM_DIR
|
||||||
|
[[ ! -d $CACHE_DIR ]] && mkdir $CACHE_DIR
|
||||||
|
}
|
||||||
|
|
||||||
|
install_files
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
xsetroot -name "$(exec $RC_LOCATION)"
|
xsetroot -name "$(exec $RC_LOCATION)"
|
||||||
done
|
done
|
||||||
|
|
23
install.sh
23
install.sh
|
@ -1,9 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CONFIG_DIR="/home/$USER/.config/dwmbar"
|
|
||||||
MODULES_DIR="$CONFIG_DIR/modules"
|
|
||||||
CUSTOM_DIR="$MODULES_DIR/custom"
|
|
||||||
DWMBARRC="$CONFIG_DIR/dwmbarrc"
|
|
||||||
DWMBAR="/usr/bin/dwmbar"
|
DWMBAR="/usr/bin/dwmbar"
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]
|
if [ "$EUID" -ne 0 ]
|
||||||
|
@ -15,13 +11,14 @@ if [[ ! -f "dwmbar" ]]; then
|
||||||
echo "dwmbar executable not found."
|
echo "dwmbar executable not found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create /usr/share/dwmbar
|
||||||
|
# Containing example dwmbarrc and modules
|
||||||
|
|
||||||
|
mkdir --parents "/usr/share/dwmbar/"
|
||||||
|
|
||||||
|
cp -r "./modules" "/usr/share/dwmbar/modules"
|
||||||
|
cp -r "./dwmbarrc" "/usr/share/dwmbar/dwmbarrc"
|
||||||
|
|
||||||
|
echo "./dwmbar --> /usr/bin/dwmbar"
|
||||||
cp "./dwmbar" "/usr/bin/dwmbar"
|
cp "./dwmbar" "/usr/bin/dwmbar"
|
||||||
|
[[ $? -eq 0 ]] && echo "Installation completed successfully"
|
||||||
mkdir -p "$CUSTOM_DIR"
|
|
||||||
|
|
||||||
for script in $(ls modules); do
|
|
||||||
echo "modules/$script -> $MODULES_DIR/$script"
|
|
||||||
cp "modules/$script" "$MODULES_DIR/$script"
|
|
||||||
done
|
|
||||||
|
|
||||||
[[ ! -f "$DWMBARRC" ]] && cp "./dwmbarrc" "$DWMBARRC"
|
|
||||||
|
|
Loading…
Reference in a new issue