From 3aa79de68b3eb97699c768b239349b087c93d5d2 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 29 Jul 2016 11:20:11 -0500 Subject: [PATCH] fix bar paths --- env/wm/extras/bar/formatter.bash | 7 +++---- env/wm/extras/bar/modules/bspwm-bm.bash | 4 ++-- env/wm/extras/bar/modules/clock-bm.bash | 2 +- env/wm/extras/bar/modules/date-bm.bash | 2 +- env/wm/extras/bar/modules/module.bash | 17 ----------------- .../extras/bar/modules/pacaur-updates-bm.bash | 2 +- env/wm/extras/bar/start.bash | 6 +++--- env/x/xinitrc | 2 +- variables.bash | 1 + 9 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 env/wm/extras/bar/modules/module.bash diff --git a/env/wm/extras/bar/formatter.bash b/env/wm/extras/bar/formatter.bash index 40b1a14..e9e2065 100755 --- a/env/wm/extras/bar/formatter.bash +++ b/env/wm/extras/bar/formatter.bash @@ -1,13 +1,12 @@ #!/usr/bin/env bash source "$DOTFILES_PATH/variables.bash" -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" # export BAR_LOG="$PWD/bar.log" # echo -e "BEGIN BAR LOG\n" > "$BAR_LOG" reload_colors() { - source "$DOTFILES_PATH/wm/extras/bar/colors.bash" + source "$BAR_PATH/colors.bash" } # trap reload_colors SIGUSR1 @@ -27,12 +26,12 @@ register_bar_module() { MODULE_INIT[$1]=$4 ${MODULE_INIT[$1]} & PID=$! - echo $PID > "$DOTFILES_PATH/wm/extras/bar/modules/$3.pid" + echo $PID > "$BAR_PATH/modules/$3.pid" # echo -e "Registered Bar Module: $1 $2 $3 $4 with PID $PID" >> "$BAR_LOG" } export -f register_bar_module -for f in "$DOTFILES_PATH/wm/extras/bar/modules/"*-bm.bash; do +for f in "$BAR_PATH/modules/"*-bm.bash; do source "$f" done diff --git a/env/wm/extras/bar/modules/bspwm-bm.bash b/env/wm/extras/bar/modules/bspwm-bm.bash index 4e0d5fb..a2673c5 100644 --- a/env/wm/extras/bar/modules/bspwm-bm.bash +++ b/env/wm/extras/bar/modules/bspwm-bm.bash @@ -1,8 +1,8 @@ #!/usr/bin/env bash source "$DOTFILES_PATH/variables.bash" -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" -source "$DOTFILES_PATH/wm/extras/bar/modules/module.bash" +source "$BAR_PATH/colors.bash" +source "$BAR_PATH/modules/module.bash" PRIORITY=25000 diff --git a/env/wm/extras/bar/modules/clock-bm.bash b/env/wm/extras/bar/modules/clock-bm.bash index 10faaba..3423462 100644 --- a/env/wm/extras/bar/modules/clock-bm.bash +++ b/env/wm/extras/bar/modules/clock-bm.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash source "$DOTFILES_PATH/variables.bash" -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" +source "$BAR_PATH/colors.bash" PRIORITY=38000 diff --git a/env/wm/extras/bar/modules/date-bm.bash b/env/wm/extras/bar/modules/date-bm.bash index 75a63c8..ec51e54 100644 --- a/env/wm/extras/bar/modules/date-bm.bash +++ b/env/wm/extras/bar/modules/date-bm.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash source "$DOTFILES_PATH/variables.bash" -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" +source "$BAR_PATH/colors.bash" PRIORITY=35000 diff --git a/env/wm/extras/bar/modules/module.bash b/env/wm/extras/bar/modules/module.bash deleted file mode 100644 index f3af2e7..0000000 --- a/env/wm/extras/bar/modules/module.bash +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -source "$DOTFILES_PATH/variables.bash" -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" - -reserve_bar_module_pid() { - FILE="$DOTFILES_PATH/wm/extras/bar/modules/$1.bm.pid" - if [[ -f "$FILE" ]]; then - - return 1 - else - echo "Starting bar module $1 witrh PID $!" - $2 & - return 0 - fi -} - diff --git a/env/wm/extras/bar/modules/pacaur-updates-bm.bash b/env/wm/extras/bar/modules/pacaur-updates-bm.bash index 48ac86d..3318672 100644 --- a/env/wm/extras/bar/modules/pacaur-updates-bm.bash +++ b/env/wm/extras/bar/modules/pacaur-updates-bm.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash source "$DOTFILES_PATH/variables.bash" -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" +source "$BAR_PATH/colors.bash" PRIORITY=12000 diff --git a/env/wm/extras/bar/start.bash b/env/wm/extras/bar/start.bash index d73c81b..65d3746 100755 --- a/env/wm/extras/bar/start.bash +++ b/env/wm/extras/bar/start.bash @@ -10,7 +10,7 @@ function killbar() { else bspc config -m $(bspc query -M | head -n 1) bottom_padding "0" fi - for f in $(ls "$DOTFILES_PATH"/wm/extras/bar/modules/*.pid 2>/dev/null); do + for f in $(ls "$BAR_PATH"/modules/*.pid 2>/dev/null); do # echo "KILLING MODULE PROCESS $f WITH PID $(cat "$f")" # kill -SIGTERM $(cat "$f") rm "$f" @@ -42,7 +42,7 @@ else BAR_B="-b" fi -source "$DOTFILES_PATH/wm/extras/bar/colors.bash" +source "$BAR_PATH/colors.bash" -cat "$BAR_FIFO" | "$DOTFILES_PATH/wm/extras/bar/formatter.bash" | \ +cat "$BAR_FIFO" | "$BAR_PATH/formatter.bash" | \ lemonbar $BAR_B -g "$WIDTH"x"$BAR_HEIGHT"+"$BAR_MARGIN"+"$POS_Y" -u "$BAR_BORDER_WIDTH" -f "$BAR_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B"$COLOR_BACKGROUND" -n "$BAR_WID" diff --git a/env/x/xinitrc b/env/x/xinitrc index c354c46..f51532b 100644 --- a/env/x/xinitrc +++ b/env/x/xinitrc @@ -17,7 +17,7 @@ xset s off & # start the bar if we want it if [ "$BAR_ON_XINIT" -eq 1 ]; then - "$DOTFILES_PATH/wm/extras/bar/start.bash" & + "$BAR_PATH/start.bash" & fi # fire up wm diff --git a/variables.bash b/variables.bash index bbf6535..3a3a9fd 100755 --- a/variables.bash +++ b/variables.bash @@ -41,4 +41,5 @@ if [ -a "$HOME/.bashrc_env" ]; then fi # various paths that are used in the dotfiles +BAR_PATH="$DOTFILES_PATH/env/wm/extras/bar"