Browse Source

Major Update

coc
Schneider 7 years ago
parent
commit
5fb44831c0
  1. 26
      bin/battery_indicator.sh
  2. 3
      tmux/theme.sh
  3. 1
      vim/ftplugin/go.vim
  4. 12
      vim/neosnippets/go.snip
  5. 1
      vimrc.symlink

26
bin/battery_indicator.sh

@ -0,0 +1,26 @@
#!/bin/bash
# modified from http://ficate.com/blog/2012/10/15/battery-life-in-the-land-of-tmux/
HEART='♥ '
if [[ `uname` == 'Linux' ]]; then
current_charge=$(cat /proc/acpi/battery/BAT1/state | grep 'remaining capacity' | awk '{print $3}')
total_charge=$(cat /proc/acpi/battery/BAT1/info | grep 'last full capacity' | awk '{print $4}')
else
battery_info=`ioreg -rc AppleSmartBattery`
current_charge=$(echo $battery_info | grep -o '"CurrentCapacity" = [0-9]\+' | awk '{print $3}')
total_charge=$(echo $battery_info | grep -o '"MaxCapacity" = [0-9]\+' | awk '{print $3}')
fi
charged_slots=$(echo "((($current_charge/$total_charge)*10)/3)+1" | bc -l | cut -d '.' -f 1)
if [[ $charged_slots -gt 3 ]]; then
charged_slots=3
fi
echo -n '#[fg=colour196]'
for i in `seq 1 $charged_slots`; do echo -n "$HEART"; done
if [[ $charged_slots -lt 3 ]]; then
echo -n '#[fg=colour254]'
for i in `seq 1 $(echo "3-$charged_slots" | bc)`; do echo -n "$HEART"; done
fi

3
tmux/theme.sh

@ -51,10 +51,11 @@ set-window-option -g clock-mode-colour $tm_color_active
#tm_tunes="#[fg=$tm_color_music]#(osascript ~/.dotfiles/applescripts/tunes.scpt)"
#tm_battery="#(~/.dotfiles/bin/battery_indicator.sh)"
tm_battery="#[fg=$tm_color_inactive]#(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | awk '{print $2}')"
tm_date="#[fg=$tm_color_inactive] %R %d %b"
tm_host="#[fg=$tm_color_feature,bold]#h"
tm_session_name="#[fg=$tm_color_feature,bold]$tm_icon #S"
set -g status-left $tm_session_name' '
set -g status-right $tm_tunes' '$tm_date' '$tm_host
set -g status-right $tm_battery' '$tm_date' '$tm_host

1
vim/ftplugin/go.vim

@ -8,3 +8,4 @@ au FileType go nmap <leader>t <Plug>(go-test)
au FileType go nmap <leader>c <Plug>(go-coverage)
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>ml <Plug>(go-metalinter)
au FileType go nmap <Leader>r <Plug>(go-rename)

12
vim/neosnippets/go.snip

@ -0,0 +1,12 @@
snippet middleware
options head
func ${1}(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
${2}
next(r, rw)
}
snippet handler
options head
func ${1}(w http.ResponseWriter, r *http.Request) {
${2}
}

1
vimrc.symlink

@ -223,3 +223,4 @@ smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'
Loading…
Cancel
Save