stuff I forgot to commit from a while ago
This commit is contained in:
parent
455e2a07bb
commit
8f8193881e
8 changed files with 74 additions and 42 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ colors/gen/vendor
|
|||
colors/gen/tmp
|
||||
*.lock
|
||||
*.log
|
||||
*.pid
|
||||
|
|
|
@ -50,6 +50,9 @@ alias emacs="emacs -nw"
|
|||
# arch aliases
|
||||
alias archupdate="pacaur -Syyu --noconfirm --noedit"
|
||||
|
||||
# wm aliases
|
||||
alias startbar="source $DOTFILES_PATH/wm/extras/bar/start.bash"
|
||||
|
||||
export EDITOR="vim"
|
||||
if command -v nvim >/dev/null 2>&1; then
|
||||
alias vim="nvim"
|
||||
|
|
|
@ -6,5 +6,3 @@ selectp -U
|
|||
splitw -v -p 50
|
||||
resize-pane -x 100
|
||||
selectp -L
|
||||
splitw -h -p 50
|
||||
selectp -L
|
||||
|
|
|
@ -13,12 +13,13 @@ source "$DOTFILES_PATH/scripts/get_color.sh"
|
|||
|
||||
export BAR_ON_XINIT=0
|
||||
export BAR_FIFO="$DOTFILES_PATH/wm_bar_fifo.lock"
|
||||
export BAR_TOP=1
|
||||
export BAR_TOP=0
|
||||
export BAR_MARGIN=$WINDOW_GAP
|
||||
export BAR_HEIGHT=20
|
||||
export BAR_BORDER_WIDTH=1
|
||||
export BAR_FONT_FAMILY="$PRIMARY_FONT_FAMILY_WITH_SIZE"
|
||||
export BAR_UNDERLINE=1
|
||||
export BAR_WID="wmpanel"
|
||||
|
||||
# load per-device bashrc_env if it exists
|
||||
if [ -a "$HOME/.bashrc_env" ]; then
|
||||
|
|
|
@ -17,9 +17,13 @@ register_bar_module "$PRIORITY" "$MATCH" "bar_module_pacaur"
|
|||
|
||||
bar_module_pacaur_updater() {
|
||||
while true; do
|
||||
NUM_PACKAGES=$(pacaur -Syq > /dev/null && pacaur -Qqu | wc -l)
|
||||
echo -e "$MATCH_PREFIX""$NUM_PACKAGES" > "$BAR_FIFO"
|
||||
sleep 300
|
||||
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"
|
||||
sleep 300
|
||||
fi
|
||||
done
|
||||
}
|
||||
bar_module_pacaur_updater &
|
||||
|
|
47
wm/extras/bar/run_bar.bash
Executable file
47
wm/extras/bar/run_bar.bash
Executable 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
|
|
@ -1,41 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source "$DOTFILES_PATH/variables.bash"
|
||||
export BAR_PID_FILE="$DOTFILES_PATH/wm_bar.pid"
|
||||
|
||||
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
|
||||
"$DOTFILES_PATH/wm/extras/bar/run_bar.bash" &
|
||||
|
||||
echo "$!" > "$BAR_PID_FILE"
|
||||
echo "Starting bar with PID $!"
|
||||
|
||||
export BAR_PID="$!"
|
||||
|
||||
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
|
||||
|
|
|
@ -22,7 +22,7 @@ super + {s,f}
|
|||
|
||||
# set modes to pseudo_tiled/fullscreen for current node
|
||||
super + shift + {s,f}
|
||||
bspc node -t {pseudo_tiled,fullscreen}
|
||||
bspc node -t {pseudo_tiled,fullscreen -l above}
|
||||
|
||||
# focus the last node/desktop
|
||||
super + {grave,Tab}
|
||||
|
|
Reference in a new issue