work on bar

This commit is contained in:
Daniel Flanagan 2016-01-11 09:22:54 -06:00
parent 4936e6e1c6
commit 642c009520
11 changed files with 131 additions and 18 deletions

View File

@ -1,14 +1,4 @@
#!/usr/bin/env bash
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd)
source "$DIR/variables.bash"
mkdir -p "$REPOSITORY_PATH"
git clone https://github.com/LemonBoy/bar.git "$REPOSITORY_PATH/lemonbar"
cd "$REPOSITORY_PATH/lemonbar"
make
sudo make install
cd -
pacaur -S lemonbar-xft-git

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/.." && pwd)
source $DIR/variables.bash
sudo pacman -S mplayer --noconfirm
git clone https://github.com/malcolmstill/thunner.git "$REPOSITORY_PATH/thunner"
sudo pip2 install gmusicapi
sudo ln -s "$REPOSITORY_PATH/thunner/thunner" /usr/bin/thunner

View File

@ -9,6 +9,7 @@ sudo pacman -S \
the_silver_searcher \
thunar \
luakit \
alsa-utils \
--noconfirm
pacaur -S \

1
misc/thunner/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
thunnerrc

View File

@ -0,0 +1,6 @@
email your@gmail.account
pass app_specific_password
color mycolor blue default
assign mycolor header-text
mobile-id your_android_device_id

8
misc/thunner/link.bash Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/../.." && pwd)
source "$DIR/variables.bash"
rm -f "$HOME/.thunnerrc"
ln -s "$DOTFILES_PATH/misc/thunner/thunnerrc" "$HOME/.thunnerrc"

View File

@ -11,7 +11,10 @@ BORDER_WIDTH=2
BAR_FIFO="$DOTFILES_PATH/wm_bar_fifo.lock"
BAR_TOP=0
BAR_MARGIN=$WINDOW_GAP
BAR_HEIGHT=30
BAR_HEIGHT=28
BAR_BORDER_WIDTH=2
BAR_FONT_FAMILY="$PRIMARY_FONT_FAMILY_WITH_SIZE"
BAR_UNDERLINE=1
# load per-device bashrc_env if it exists
if [ -a "$HOME/.bashrc_env" ]; then

View File

@ -327,6 +327,18 @@ map <silent> <F8> <Esc>:cnext<CR>
" keep that dumb window from popping up
map q: :q
" sane n/N behavior
nnoremap <expr> n 'Nn'[v:searchforward]
nnoremap <expr> N 'nN'[v:searchforward]
" better command history navigation
cnoremap <c-n> <down>
cnoremap <c-p> <up>
" keep selection after indenting visual
xnoremap < <gv
xnoremap > >gv
command! UseFoldMarkers set foldmethod=marker
" compile & link c code (alt+<F9> write + compile, ctrl+<F9> compile + run) (c.vim plugin)

View File

@ -0,0 +1,6 @@
export COLOR_FOREGROUND="#ff$(get_color 05)"
export COLOR_DARK="#ff$(get_color 03)"
export COLOR_BACKGROUND="#ff$(get_color 00)"
export COLOR_HIGHLIGHT="#ff$(get_color 0D)"
export COLOR_URGENT="#ff$(get_color 08)"

67
wm/extras/bar/formatter.bash Executable file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env bash
source "$DOTFILES_PATH/variables.bash"
source "$DOTFILES_PATH/wm/extras/bar/colors.bash"
ul="u"
if [ $BAR_UNDERLINE -eq 1 ]; then
:
else
ul="o"
fi
while read -r line; do
case $line in
# bspwm
W*)
wm_info=""
IFS=':' # this is some magic variable... you need it
set -- ${line#?}
while [ $# -gt 0 ]; do
item=$1
name=${item#?}
cname="$name"
case $item in
M*)
# active monitor
# do nothing
;;
m*)
# inactive monitor
# do nothing
;;
O*)
# focused occupied desktop
wm_info="${wm_info} %{F$COLOR_HIGHLIGHT}%{U$COLOR_HIGHLIGHT}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}"
;;
F*)
# focused free desktop
wm_info="${wm_info} %{F$COLOR_DARK}%{U$COLOR_DARK}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}"
;;
U*)
# focused occupied desktop
wm_info="${wm_info} %{F$COLOR_URGENT}%{U$COLOR_URGENT}%{+${ul}}${cname}%{-${ul}}%{U-}%{F-}"
;;
o*)
# occupied desktop
wm_info="${wm_info} %{F$COLOR_FOREGROUND}${cname}%{F-}"
;;
f*)
# free desktop
wm_info="${wm_info} %{F$COLOR_DARK}${cname}%{F-}"
;;
u*)
# urgent desktop
wm_info="${wm_info} %{F$COLOR_URGENT}${cname}%{F-}"
;;
L*)
# layout
;;
esac
shift
done
;;
esac
printf " %s \n" "%{T1}What up, bar? %{c}${wm_info} %{r}Clock here or something"
done

View File

@ -2,8 +2,6 @@
source "$DOTFILES_PATH/variables.bash"
trap killbar INT TERM QUIT EXIT
function killbar() {
if [ $BAR_TOP -eq 1 ]; then
bspc config -m $(bspc query -M | head -n 1) top_padding "0"
@ -12,22 +10,30 @@ function 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
bspc subscribe all > "$BAR_FIFO" &
# 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))
HEIGHT=`xrandr -q | egrep '(^| )connected( |$)' | tr '+' '\n' | tr 'x' '\n' | head -n 2 | tail -n 1`
POS_Y=0
BAR_B=""
if [ $BAR_TOP -eq 1 ]; then
:
else
POS_Y=$((HEIGHT-BAR_HEIGHT))
BAR_B="-b"
fi
lemonbar -g "$WIDTH"x"$BAR_HEIGHT"+"$BAR_MARGIN"+"$POS_Y"
source "$DOTFILES_PATH/wm/extras/bar/colors.bash"
cat "$BAR_FIFO" | "$DOTFILES_PATH/wm/extras/bar/formatter.bash" | lemonbar $BAR_B -d -g "$WIDTH"x"$BAR_HEIGHT"+"$BAR_MARGIN"+"$POS_Y" -u "$BAR_BORDER_WIDTH" -f "$BAR_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND"