stuff I forgot to commit from a while ago

This commit is contained in:
Daniel Flanagan 2016-05-04 15:18:41 -05:00
parent 455e2a07bb
commit 8f8193881e
8 changed files with 74 additions and 42 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ colors/gen/vendor
colors/gen/tmp colors/gen/tmp
*.lock *.lock
*.log *.log
*.pid

View file

@ -50,6 +50,9 @@ alias emacs="emacs -nw"
# arch aliases # arch aliases
alias archupdate="pacaur -Syyu --noconfirm --noedit" alias archupdate="pacaur -Syyu --noconfirm --noedit"
# wm aliases
alias startbar="source $DOTFILES_PATH/wm/extras/bar/start.bash"
export EDITOR="vim" export EDITOR="vim"
if command -v nvim >/dev/null 2>&1; then if command -v nvim >/dev/null 2>&1; then
alias vim="nvim" alias vim="nvim"

View file

@ -6,5 +6,3 @@ selectp -U
splitw -v -p 50 splitw -v -p 50
resize-pane -x 100 resize-pane -x 100
selectp -L selectp -L
splitw -h -p 50
selectp -L

View file

@ -13,12 +13,13 @@ source "$DOTFILES_PATH/scripts/get_color.sh"
export BAR_ON_XINIT=0 export BAR_ON_XINIT=0
export BAR_FIFO="$DOTFILES_PATH/wm_bar_fifo.lock" export BAR_FIFO="$DOTFILES_PATH/wm_bar_fifo.lock"
export BAR_TOP=1 export BAR_TOP=0
export BAR_MARGIN=$WINDOW_GAP export BAR_MARGIN=$WINDOW_GAP
export BAR_HEIGHT=20 export BAR_HEIGHT=20
export BAR_BORDER_WIDTH=1 export BAR_BORDER_WIDTH=1
export BAR_FONT_FAMILY="$PRIMARY_FONT_FAMILY_WITH_SIZE" export BAR_FONT_FAMILY="$PRIMARY_FONT_FAMILY_WITH_SIZE"
export BAR_UNDERLINE=1 export BAR_UNDERLINE=1
export BAR_WID="wmpanel"
# load per-device bashrc_env if it exists # load per-device bashrc_env if it exists
if [ -a "$HOME/.bashrc_env" ]; then if [ -a "$HOME/.bashrc_env" ]; then

View file

@ -17,9 +17,13 @@ register_bar_module "$PRIORITY" "$MATCH" "bar_module_pacaur"
bar_module_pacaur_updater() { bar_module_pacaur_updater() {
while true; do while true; do
NUM_PACKAGES=$(pacaur -Syq > /dev/null && pacaur -Qqu | wc -l) if [ -e "/var/lib/pacman/db.lck" ]; then
sleep 10
else
NUM_PACKAGES=$(pacaur -Syq --silent >/dev/null 2>/dev/null && pacaur -Qqu | wc -l)
echo -e "$MATCH_PREFIX""$NUM_PACKAGES" > "$BAR_FIFO" echo -e "$MATCH_PREFIX""$NUM_PACKAGES" > "$BAR_FIFO"
sleep 300 sleep 300
fi
done done
} }
bar_module_pacaur_updater & bar_module_pacaur_updater &

47
wm/extras/bar/run_bar.bash Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env bash
source "$DOTFILES_PATH/variables.bash"
export BAR_RUNNING=1
function killbar() {
export BAR_RUNNING=0
if [ $BAR_TOP -eq 1 ]; then
bspc config -m $(bspc query -M | head -n 1) top_padding "0"
else
bspc config -m $(bspc query -M | head -n 1) bottom_padding "0"
fi
}
if [ -e "$BAR_PID_FILE" ]; then
killbar
fi
trap killbar INT TERM QUIT EXIT
rm -f "$BAR_FIFO"
mkfifo "$BAR_FIFO"
if [ $BAR_TOP -eq 1 ]; then
bspc config -m $(bspc query -M | head -n 1) top_padding "$BAR_HEIGHT"
else
bspc config -m $(bspc query -M | head -n 1) bottom_padding "$BAR_HEIGHT"
fi
# get width of our main monitor
WIDTH=`xrandr -q | egrep '(^| )connected( |$)' | tr 'x' '\n' | head -n 1 | awk '{print $NF}'`
WIDTH=$((WIDTH-BAR_MARGIN-BAR_MARGIN))
BAR_B=""
if [ $BAR_TOP -eq 1 ]; then
:
else
BAR_B="-b"
fi
source "$DOTFILES_PATH/wm/extras/bar/colors.bash"
cat "$BAR_FIFO" | "$DOTFILES_PATH/wm/extras/bar/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"
killbar

View file

@ -1,41 +1,19 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$DOTFILES_PATH/variables.bash" export BAR_PID_FILE="$DOTFILES_PATH/wm_bar.pid"
export BAR_RUNNING=1 "$DOTFILES_PATH/wm/extras/bar/run_bar.bash" &
function killbar() {
export BAR_RUNNING=0 echo "$!" > "$BAR_PID_FILE"
if [ $BAR_TOP -eq 1 ]; then echo "Starting bar with PID $!"
bspc config -m $(bspc query -M | head -n 1) top_padding "0"
else export BAR_PID="$!"
bspc config -m $(bspc query -M | head -n 1) bottom_padding "0"
fi stopbar() {
kill -SIGINT $(cat "$BAR_PID_FILE")
rm -f "$BAR_PID_FILE"
} }
export -f stopbar
trap killbar INT TERM QUIT EXIT xdo lower -a wmpanel
rm -f "$BAR_FIFO"
mkfifo "$BAR_FIFO"
if [ $BAR_TOP -eq 1 ]; then
bspc config -m $(bspc query -M | head -n 1) top_padding "$BAR_HEIGHT"
else
bspc config -m $(bspc query -M | head -n 1) bottom_padding "$BAR_HEIGHT"
fi
# get width of our main monitor
WIDTH=`xrandr -q | egrep '(^| )connected( |$)' | tr 'x' '\n' | head -n 1 | awk '{print $NF}'`
WIDTH=$((WIDTH-BAR_MARGIN-BAR_MARGIN))
BAR_B=""
if [ $BAR_TOP -eq 1 ]; then
:
else
BAR_B="-b"
fi
source "$DOTFILES_PATH/wm/extras/bar/colors.bash"
cat "$BAR_FIFO" | "$DOTFILES_PATH/wm/extras/bar/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"
killbar

View file

@ -22,7 +22,7 @@ super + {s,f}
# set modes to pseudo_tiled/fullscreen for current node # set modes to pseudo_tiled/fullscreen for current node
super + shift + {s,f} super + shift + {s,f}
bspc node -t {pseudo_tiled,fullscreen} bspc node -t {pseudo_tiled,fullscreen -l above}
# focus the last node/desktop # focus the last node/desktop
super + {grave,Tab} super + {grave,Tab}