added bar modules, work on new bar system

This commit is contained in:
Daniel Flanagan 2016-01-12 13:39:54 -06:00
parent 333e5edd7b
commit a4c06b34cf
5 changed files with 20 additions and 52 deletions

View file

@ -3,6 +3,9 @@ export DOTFILES_PATH=$HOME/.dotfiles
BASE16_SHELL="$DOTFILES_PATH/colors/shell"
[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL"
# disable ctrl-s terminal freeze
stty -ixon
# filesystem aliases
alias lx='ls -lXB' # order by filetype
alias lk='ls -lSr' # order by filesize reversed

View file

@ -10,58 +10,23 @@ else
ul="o"
fi
export $MODULE_MATCH=
export $MODULE_CALLBACK=
export $MODULE_DATA=
register_bar_module() {
:
}
export -f register_bar_module
source "$DOTFILES_PATH/wm/extras/bar/modules/*-bm.bash"
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"
content=
for i in $MODULE_MATCH; do
content=$content$i
done
printf " %s \n" "$content"
done

View file

View file

View file