Marcel Schneider
8 years ago
9 changed files with 147 additions and 11 deletions
-
26bin/battery_indicator.sh
-
23install.sh
-
3tmux/theme.sh
-
7tmux/tmux.conf.symlink
-
11vim/ftplugin/go.vim
-
19vim/neosnippets/go.snip
-
55vimrc.symlink
-
2zsh/aliases.zsh
-
10zsh/custom.zsh
@ -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 |
@ -0,0 +1,23 @@ |
|||
#!/usr/bin/env bash |
|||
|
|||
DOTFILES=$HOME/.dotfiles |
|||
|
|||
if [[ ! -d ~/.oh-my-zsh ]]; then |
|||
echo -e "\nInstall oh-my-zsh" |
|||
echo "=============================" |
|||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
|||
ln -s $DOTFILES/zsh/custom.zsh ~/.oh-my-zsh/custom/custom.zsh |
|||
fi |
|||
|
|||
echo -e "\nCreating symlinks" |
|||
echo "==============================" |
|||
linkables=$( find -H "$DOTFILES" -maxdepth 3 -name '*.symlink' ) |
|||
for file in $linkables ; do |
|||
target="$HOME/.$( basename $file '.symlink' )" |
|||
if [ -e $target ]; then |
|||
echo "~${target#$HOME} already exists... Skipping." |
|||
else |
|||
echo "Creating symlink for $file" |
|||
ln -s $file $target |
|||
fi |
|||
done |
@ -0,0 +1,11 @@ |
|||
let g:syntastic_go_checkers = ['go', 'golint', 'govet'] |
|||
let g:go_fmt_command = "goimports" |
|||
|
|||
au FileType go nmap <F5> <Plug>(go-run) |
|||
au FileType go nmap <leader>gi <Plug>(go-imports) |
|||
au FileType go nmap <leader>b <Plug>(go-build) |
|||
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) |
@ -0,0 +1,19 @@ |
|||
snippet middleware |
|||
options head |
|||
func ${1}(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) { |
|||
${2} |
|||
next(w, r |
|||
} |
|||
|
|||
snippet handler |
|||
options head |
|||
func ${1}(w http.ResponseWriter, r *http.Request) { |
|||
${2} |
|||
} |
|||
|
|||
snippet method |
|||
abbr meth |
|||
options head |
|||
func (${1}) ${2}(${3}) ${4}{ |
|||
${5} |
|||
} |
@ -0,0 +1,10 @@ |
|||
ZSH_THEME="agnoster" |
|||
HIST_STAMPS="dd.mm.yyyy" |
|||
COMPLETION_WAITING_DOTS="true" |
|||
|
|||
export EDITOR="vim" |
|||
|
|||
export goschneider="$HOME/go/src/git.webschneider.org" |
|||
|
|||
source $HOME/.dotfiles/zsh/aliases.zsh |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue