diff options
Diffstat (limited to 'dwmbar')
-rwxr-xr-x | dwmbar | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -15,17 +15,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -VERSION="0.1" +VERSION="0.2" DEFAULT_CONFIG_DIR="/usr/share/dwmbar" DEFAULT_MODULES_DIR="$DEFAULT_CONFIG_DIR/modules" -DEFAULT_RC_LOCATION="$DEFAULT_CONFIG_DIR/dwmbarrc" +DEFAULT_BAR_LOCATION="$DEFAULT_CONFIG_DIR/bar.sh" +DEFAULT_CONFIG_LOCATION="$DEFAULT_CONFIG_DIR/config" -RC_LOCATION="/home/$USER/.config/dwmbar/dwmbarrc" CONFIG_DIR="/home/$USER/.config/dwmbar" -MODULES_DIR="$CONFIG_DIR/modules" -CUSTOM_DIR="$MODULES_DIR/custom" -DWMBARRC="$CONFIG_DIR/dwmbarrc" +CUSTOM_DIR="$CONFIG_DIR/custom" +CONFIG_FILE="$CONFIG_DIR/config" CACHE_DIR="$CONFIG_DIR/.cache" print_help(){ @@ -37,8 +36,7 @@ print_help(){ 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 + [[ ! -f $CONFIG_FILE ]] && cp /usr/share/dwmbar/config $CONFIG_FILE [[ ! -d $CUSTOM_DIR ]] && mkdir $CUSTOM_DIR [[ ! -d $CACHE_DIR ]] && mkdir $CACHE_DIR } @@ -54,13 +52,18 @@ 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 + + if [[ ! -f $DEFAULT_CONFIG_LOCATION ]]; then + echo "$DEFAULT_CONFIG_LOCATION does not exist." > /dev/stderr + exit 1 + fi } -while getopts 'v' flag; do +while getopts 'vc' flag; do case "${flag}" in v) print_help exit 0 ;; @@ -72,5 +75,5 @@ done check_files while :; do - xsetroot -name "$(exec $RC_LOCATION)" + xsetroot -name "$(exec $DEFAULT_BAR_LOCATION)" done |