dotfiles

configuration files for different softwares
git clone git://z3bra.org/dotfiles
Log | Files | Refs

commit 99c0cea75f52ab6548d7d26bf875162b28eddd03
parent bef7e40ca8606900d8c6b24f524a47a6cf4fc437
Author: z3bra <willy@mailoo.org>
Date:   Tue May  6 21:52:46 2014

Merge branch 'master' of git:dotfiles

Diffstat:
 Xresources            |  33 +++++++---
 bashrc                |  76 +++++++++++++---------
 irssi/config          |  36 +++-------
 profile               |   9 +++-
 vim/colors/shblah.vim | 176 ++++++++++++++++++++++++++++-----------------------
 vimrc                 |   4 +-
 xinitrc               |  12 ++-
 7 files changed, 205 insertions(+), 141 deletions(-)

diff --git a/Xresources b/Xresources @@ -52,27 +52,46 @@ URxvt.keysym.M-v: perl:keyboard-select:activate ! Colored man pages URxvt.colorIT: #cacaca URxvt.colorBD: #eee685 -URxvt.colorUL: #a28c64 +URxvt.colorUL: #d45f10 ! XTerm --------------------------------------------------------- -xterm*background:#222222 -xterm*foreground:#e8e9ca +xterm*background:#ffffff +xterm*foreground:#1d1d1d + +xterm*color0: #1d1d1d +xterm*color1: #784742 +xterm*color2: #427363 +xterm*color3: #665847 +xterm*color4: #6a708b +xterm*color5: #7a378b +xterm*color6: #52707b +xterm*color7: #b3b3b3 + +xterm*color8: #4c4c4c +xterm*color9: #d43f10 +xterm*color10: #cef318 +xterm*color11: #ede265 +xterm*color12: #6ac0fd +xterm*color13: #ef79ae +xterm*color14: #49d4dd +xterm*color15: #1d1d1d + xterm*scrollBar: false -xterm*faceName: tamsyn -xterm*faceSize: 8 +xterm*faceName: gohufont +xterm*faceSize: 14 xterm*boldMode: false xterm*cutNewline: false xterm*on4Clicks: group xterm*on5Clicks: page -xterm*internalBorder: 8 +xterm*internalBorder: 2 xterm*metaSendsEscape: true xterm*colorBD: #ffffff xterm*colorBDMode: true xterm*cursorBlink: false xterm*cursorColor: #e8e9ca xterm*veryBoldColors: 14 -xterm*loginShell: true +xterm*loginShell: false xterm*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48,35:48,58:48,63:48,61:48,44:48,38:48,59:48 xterm*jumpScroll: true xterm*multiScroll: true diff --git a/bashrc b/bashrc @@ -14,27 +14,15 @@ fg=('\[\e[0;30m\]' '\[\e[0;31m\]' '\[\e[0;32m\]' '\[\e[0;33m\]' '\[\e[1;34m\]' '\[\e[1;35m\]' '\[\e[1;36m\]' '\[\e[1;37m\]') nofg='\[\e[0m\]' -case $HOSTNAME in - 'cosette') fd=${fg[6]} ;; - 'gavroche') fd=${fg[12]} ;; - 'javert') fd=${fg[11]} ;; - 'triton') fd=${fg[8]} ;; - 'EMIS030') fd=${fg[1]} ;; - 'ks395925.kimsufi.com') fd=${fg[13]} ;; - *) fd=${fg[15]} ;; -esac - #MIN=1 #MAX=15 #RANDOM_COLOR=$(( $MIN+(`od -An -N2 -i /dev/random` )%($MAX-$MIN+1) )) #fd=${fg[$RANDOM_COLOR]} +fd=${fg[15]} PS1='' -PS1='';[ -n "$SSH_CLIENT" ] && PS1="${fd}(${fg[8]}$(hostname|cut -b-2)${fd})" -export PS1="${fd}─${PS1}${fd}──── ${nofg}" - -# command line editing -set -o vi +test -n "$SSH_CLIENT" && PS1="${fg[8]} $(hostname|cut -b-1) ${fd}" +export PS1="${fd}─$PS1──${nofg} " # use auto-completion after those words complete -cf sudo @@ -46,31 +34,54 @@ complete -cf fakeroot ## FUNCTIONS {{{ -function start() { for s in $@; do /etc/rc.d/$s start; done } -function stop() { for s in $@; do /etc/rc.d/$s stop; done } -function restart() { for s in $@; do /etc/rc.d/$s restart; done } -function status() { for s in $@; do /etc/rc.d/$s status; done } +monit() { + test $# -lt 1 && exit 1 + ps -eo pcpu,pmem,size,vsize,pid,args | sed -n "1p;/$1/p" | grep -v 'sed -n' +} + +musage() { + mem_total=$(free -m |sed -n '2p'| awk '{print $2}') + mem_used=$(free -m |sed -n '3p'|awk '{print $3}') + + echo "$((${mem_total} / ${mem_used}))%" +} + +cusage() { + total="0" + perc=`ps --no-header -eo pcpu | grep -v '0.0'` + + for p in $perc; do + total=`echo $total + $p | bc`; + done + + echo "$total%" +} + +start() { for s in $@; do sudo /etc/rc.d/$s start; done } +stop() { for s in $@; do sudo /etc/rc.d/$s stop; done } +restart() { for s in $@; do sudo /etc/rc.d/$s restart; done } +status() { for s in $@; do sudo /etc/rc.d/$s status; done } -function sprunge() { +sprunge() { test -z $1 && FILE='-' || FILE=$1 curl -sF "sprunge=<${FILE}" http://sprunge.us } -function thumbify() { +thumbify() { if [ -f $1 ]; then - cp $1 thumb-$1 + cp $1 thumb/$1 if [ $2 ]; then - mogrify -resize $2 thumb-$1 + mogrify -resize $2 thumb/$1 else - mogrify -resize 250x250 thumb-$1 + mogrify -resize 250x250 thumb/$1 fi else echo "$1: not a regular file" fi } -function ttycolors() { +ttycolors() { if [ "$TERM" = "linux" ]; then echo -en "\e]P0222222" #black -> also the background echo -en "\e]P18b3e2f" #darkred @@ -107,17 +118,17 @@ mcd () { } # perform 'ls' right after entering a directory -function cd() { +cd() { builtin cd "$@" && ls -CF --color } -function build() { +build() { test -d ~/usr/ports/$1 || prtmk cd ~/usr/ports/$1 fakeroot pkgmk -d } -function ddg() { +ddg() { elinks "http://duckduckgo.com/lite?q=${*// /+}" } ## }}} @@ -148,6 +159,10 @@ alias grep="grep --color=auto" alias ll="ls -alhF --color=auto" alias l="ls -CF --color=auto" +# job control +alias mtop="ps --no-header -eo pmem,size,vsize,comm | sort -nr | sed 10q" +alias ctop="ps --no-header -eo pcpu,comm | sort -nr | sed 10q" + ## Applications alias v="vim" alias sv="EDITOR=vim sudo -e" @@ -156,7 +171,7 @@ alias vol="alsamixer" # TMUX / DTACH alias t='tmux' -alias d='dtach -A ~/tmp/irssi.sk /usr/bin/irssi' +alias d='dtach -A ~/tmp/irssi.sk -e  irssi' # BTPD alias btc="btcli -d ~/var/btp" @@ -169,9 +184,10 @@ alias pkgup='pkgadd -u' # desktop stuff if test -n "$DISPLAY"; then + alias winsize="xwininfo -id \`xprop|grep 'window id'|cut -d\ -f7\`" alias rec="ffmpeg -f x11grab -s 1440x900 -r 25 -i :0.0 output.mkv" alias wmg="echo 'group'\`xprop -root _NET_CURRENT_DESKTOP|cut -d= -f2\`|toilet -ffuture --gay" - alias cam="mplayer -tv driver=v4l2:width=320:height=240: -vo xv tv:// -geometry '99%:90%' -noborder -ontop" + alias cam="mpv -tv driver=v4l2:width=320:height=240: -vo xv tv:// -geometry '99%:90%' -ontop" fi # HANDY RICKY SCRIPT diff --git a/irssi/config b/irssi/config @@ -21,8 +21,8 @@ servers = ( autoconnect = "no"; }, { - address = "irc.unixhub.net"; - chatnet = "unixhub"; + address = "irc.nixers.net"; + chatnet = "nixers"; port = "6697"; use_ssl = "yes"; autoconnect = "yes"; @@ -65,7 +65,7 @@ chatnets = { nick = "z3bra"; autosendcmd = "/msg Q@Cserve.quakenet.org AUTH z3bra passw0rd; /unquery Q@Cserve.quakenet.org"; }; - unixhub = { + nixers = { type = "IRC"; nick = "z3bra"; autosendcmd = "/msg nickserv IDENTIFY password; /unquery nickserv"; @@ -80,14 +80,15 @@ chatnets = { channels = ( # {{{ { name = "#defrag-france"; chatnet = "qnet"; autojoin = "Yes"; }, - { name = "#unixhub"; chatnet = "unixhub"; autojoin = "Yes"; }, + { name = "#nixers"; chatnet = "nixers"; autojoin = "Yes"; }, { name = "#vim-fr"; chatnet = "fnode"; autojoin = "Yes"; }, { name = "#archlinux-fr"; chatnet = "fnode"; autojoin = "Yes"; }, { name = "#blinkenshell"; chatnet = "blink"; autojoin = "Yes"; }, - { name = "#iotek"; chatnet = "iotek"; autojoin = "Yes"; }, + { name = "#iotek"; chatnet = "iotek"; autojoin = "No"; }, { name = "#crux"; chatnet = "fnode"; autojoin = "Yes"; }, { name = "#frenchfags"; chatnet = "fnode"; autojoin = "Yes"; }, - { name = "#2f30"; chatnet = "fnode"; autojoin = "Yes"; } + { name = "#2f30"; chatnet = "fnode"; autojoin = "Yes"; }, + { name = "#morpheus"; chatnet = "oftc"; autojoin = "Yes"; } ); # }}} @@ -306,7 +307,6 @@ settings = { nick = "z3bra"; timestamp_format = " %H:%M (%d/%m)"; quit_message = "int random() { return 3; /*number randomly chosen with a dice roll*/ }"; - part_message = "I see dead memory. All the time."; }; "fe-text" = { @@ -374,8 +374,8 @@ windows = { { type = "CHANNEL"; chat_type = "IRC"; - name = "#unixhub"; - tag = "unixhub"; + name = "#nixers"; + tag = "nixers"; } ); }; @@ -404,22 +404,12 @@ windows = { { type = "CHANNEL"; chat_type = "IRC"; - name = "#iotek"; - tag = "iotek"; - } - ); - }; - 7 = { - items = ( - { - type = "CHANNEL"; - chat_type = "IRC"; name = "#crux"; tag = "fnode"; } ); }; - 8 = { + 7 = { items = ( { type = "CHANNEL"; @@ -429,13 +419,13 @@ windows = { } ); }; - 9 = { + 8 = { items = ( { type = "CHANNEL"; chat_type = "IRC"; - name = "#trompette"; - tag = "fnode"; + name = "#blinkenshell"; + tag = "blink"; } ); }; diff --git a/profile b/profile @@ -0,0 +1,9 @@ +export PATH=$PATH:~/bin:. +export MAIL=$HOME/var/mail/INBOX +export PAGER=less +export EDITOR=vim +export MPD_HOST=gavroche +export LS_COLORS="so=35:tw=91:ow=93" + +test -f ~/.bashrc && source ~/.bashrc + diff --git a/vim/colors/shblah.vim b/vim/colors/shblah.vim @@ -1,6 +1,11 @@ +" ┏━┓╻ ╻┏┓ ╻ ┏━┓╻ ╻ ╻ ╻╻┏┳┓ +" ┗━┓┣━┫┣┻┓┃ ┣━┫┣━┫ ┃┏┛┃┃┃┃ +" ┗━┛╹ ╹┗━┛┗━╸╹ ╹╹ ╹ ╹ ┗┛ ╹╹ ╹ +" -- by z3bra +" ===================================== " -" Terminal setup. -" +" A 16 colors scheme that use your terminal colors + set background=dark if version > 580 highlight clear @@ -10,80 +15,99 @@ if version > 580 endif let g:colors_name="shblah" -" -" Highlighting definitions. -" - - " - " Actual colours and styles. - " - highlight ColorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=3 - highlight Comment term=NONE cterm=bold ctermfg=0 ctermbg=NONE - highlight Constant term=NONE cterm=bold ctermfg=2 ctermbg=NONE - highlight Cursor term=NONE cterm=bold ctermfg=3 ctermbg=NONE - highlight CursorLine term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE - highlight DiffAdd term=NONE cterm=bold ctermfg=2 ctermbg=NONE - highlight DiffChange term=NONE cterm=bold ctermfg=3 ctermbg=NONE - highlight DiffDelete term=NONE cterm=bold ctermfg=1 ctermbg=NONE - highlight FoldColumn term=NONE cterm=bold ctermfg=0 ctermbg=NONE - highlight Folded term=NONE cterm=bold ctermfg=0 ctermbg=NONE - highlight Function term=NONE cterm=bold ctermfg=7 ctermbg=NONE - highlight Identifier term=NONE cterm=bold ctermfg=1 ctermbg=NONE - highlight IncSearch term=NONE cterm=NONE ctermfg=0 ctermbg=4 - highlight NonText term=NONE cterm=bold ctermfg=0 ctermbg=NONE - highlight Normal term=NONE cterm=NONE ctermfg=7 ctermbg=NONE - highlight Pmenu term=NONE cterm=NONE ctermfg=0 ctermbg=7 - highlight PreProc term=NONE cterm=bold ctermfg=3 ctermbg=NONE - highlight Search term=NONE cterm=bold ctermfg=0 ctermbg=4 - highlight Special term=NONE cterm=bold ctermfg=2 ctermbg=NONE - highlight SpecialKey term=NONE cterm=NONE ctermfg=2 ctermbg=NONE - highlight Statement term=NONE cterm=bold ctermfg=7 ctermbg=NONE - highlight StatusLine term=NONE cterm=bold ctermfg=0 ctermbg=NONE - " highlight StatusLineNC term=NONE cterm=bold ctermfg=0 ctermbg=NONE - highlight String term=NONE cterm=NONE ctermfg=1 ctermbg=NONE - highlight Todo term=NONE cterm=NONE ctermfg=0 ctermbg=1 - highlight Type term=NONE cterm=NONE ctermfg=3 ctermbg=NONE - highlight VertSplit term=NONE cterm=bold ctermfg=0 ctermbg=NONE - highlight Visual term=NONE cterm=bold ctermfg=7 ctermbg=3 +" Actual colours and styles. +highlight ColorColumn term=NONE cterm=NONE ctermfg=NONE ctermbg=3 +highlight Comment term=NONE cterm=bold ctermfg=0 ctermbg=NONE +highlight Constant term=NONE cterm=bold ctermfg=2 ctermbg=NONE +highlight Cursor term=NONE cterm=bold ctermfg=3 ctermbg=NONE +highlight CursorLine term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE +highlight DiffAdd term=NONE cterm=bold ctermfg=2 ctermbg=NONE +highlight DiffChange term=NONE cterm=bold ctermfg=3 ctermbg=NONE +highlight DiffDelete term=NONE cterm=bold ctermfg=1 ctermbg=NONE +highlight FoldColumn term=NONE cterm=bold ctermfg=0 ctermbg=NONE +highlight Folded term=NONE cterm=bold ctermfg=0 ctermbg=NONE +highlight Function term=NONE cterm=bold ctermfg=7 ctermbg=NONE +highlight Identifier term=NONE cterm=bold ctermfg=1 ctermbg=NONE +highlight IncSearch term=NONE cterm=bold ctermfg=5 ctermbg=5 +highlight NonText term=NONE cterm=bold ctermfg=0 ctermbg=NONE +highlight Normal term=NONE cterm=NONE ctermfg=7 ctermbg=NONE +highlight Pmenu term=NONE cterm=NONE ctermfg=0 ctermbg=7 +highlight PreProc term=NONE cterm=bold ctermfg=3 ctermbg=NONE +highlight Search term=NONE cterm=bold ctermfg=7 ctermbg=5 +highlight Special term=NONE cterm=bold ctermfg=2 ctermbg=NONE +highlight SpecialKey term=NONE cterm=NONE ctermfg=2 ctermbg=NONE +highlight Statement term=NONE cterm=bold ctermfg=7 ctermbg=NONE +highlight StatusLine term=NONE cterm=bold ctermfg=0 ctermbg=NONE +" highlight StatusLineNC term=NONE cterm=bold ctermfg=0 ctermbg=NONE +highlight String term=NONE cterm=NONE ctermfg=1 ctermbg=NONE +highlight TabLineSel term=NONE cterm=bold ctermfg=7 ctermbg=NONE +highlight Todo term=NONE cterm=bold ctermfg=7 ctermbg=1 +highlight Type term=NONE cterm=NONE ctermfg=3 ctermbg=NONE +highlight VertSplit term=NONE cterm=bold ctermfg=0 ctermbg=NONE +highlight Visual term=NONE cterm=bold ctermfg=7 ctermbg=3 - " - " General highlighting group links. - " - highlight! link diffAdded DiffAdd - highlight! link diffRemoved DiffDelete - highlight! link diffChanged DiffChange - highlight! link StatusLineNC StatusLine - highlight! link Title Normal - highlight! link LineNr NonText - highlight! link TabLine StatusLineNC - highlight! link TabLineFill StatusLineNC - highlight! link TabLineSel StatusLine - highlight! link VimHiGroup VimGroup +" General highlighting group links. +highlight! link diffAdded DiffAdd +highlight! link diffRemoved DiffDelete +highlight! link diffChanged DiffChange +highlight! link StatusLineNC StatusLine +highlight! link Title Normal +highlight! link LineNr NonText +highlight! link TabLine StatusLineNC +highlight! link TabLineFill StatusLineNC +highlight! link VimHiGroup VimGroup " Test the actual colorscheme -syn match Comment "__Comment.*" -syn match Constant "__Constant.*" -syn match Cursor "__Cursor.*" -syn match CursorLine "__CursorLine.*" -syn match DiffAdd "__DiffAdd.*" -syn match DiffChange "__DiffChange.*" -syn match DiffDelete "__DiffDelete.*" -syn match Folded "__Folded.*" -syn match Function "__Function.*" -syn match Identifier "__Identifier.*" -syn match IncSearch "__IncSearch.*" -syn match NonText "__NonText.*" -syn match Normal "__Normal.*" -syn match Pmenu "__Pmenu.*" -syn match PreProc "__PreProc.*" -syn match Search "__Search.*" -syn match Special "__Special.*" -syn match SpecialKey "__SpecialKey.*" -syn match Statement "__Statement.*" -syn match StatusLine "__StatusLine.*" -syn match StatusLineNC "__StatusLineNC.*" -syn match String "__String.*" -syn match Todo "__Todo.*" -syn match Type "__Type.*" -syn match VertSplit "__VertSplit.*" -syn match Visual "__Visual.*" +syn match Comment "\"__Comment.*" +syn match Constant "\"__Constant.*" +syn match Cursor "\"__Cursor.*" +syn match CursorLine "\"__CursorLine.*" +syn match DiffAdd "\"__DiffAdd.*" +syn match DiffChange "\"__DiffChange.*" +syn match DiffDelete "\"__DiffDelete.*" +syn match Folded "\"__Folded.*" +syn match Function "\"__Function.*" +syn match Identifier "\"__Identifier.*" +syn match IncSearch "\"__IncSearch.*" +syn match NonText "\"__NonText.*" +syn match Normal "\"__Normal.*" +syn match Pmenu "\"__Pmenu.*" +syn match PreProc "\"__PreProc.*" +syn match Search "\"__Search.*" +syn match Special "\"__Special.*" +syn match SpecialKey "\"__SpecialKey.*" +syn match Statement "\"__Statement.*" +syn match StatusLine "\"__StatusLine.*" +syn match StatusLineNC "\"__StatusLineNC.*" +syn match String "\"__String.*" +syn match Todo "\"__Todo.*" +syn match Type "\"__Type.*" +syn match VertSplit "\"__VertSplit.*" +syn match Visual "\"__Visual.*" + +"__Comment /* this is a comment */ +"__Constant var = SHBLAH +"__Cursor char under the cursor? +"__CursorLine Line where the cursor is +"__DiffAdd +line added from file.orig +"__DiffChange changed from file.org +"__DiffDelete -line removed from file.orig +"__Folded +--- 1 line : Folded line --- +"__Function function sblah() +"__Identifier Never ran into that actually... +"__IncSearch Next search term +"__NonText This is not a text, move on +"__Normal Typical text goes like this +"__Pmenu Currently selected menu item +"__PreProc #define SHBLAH true +"__Search This is what you're searching for +"__Special true false NULL SIGTERM +"__SpecialKey Never ran into that either +"__Statement if else return for switch +"__StatusLine Statusline of current windows +"__StatusLineNC Statusline of other windows +"__String "Hello, World!" +"__Todo TODO: remove todos from source +"__Type int float char void unsigned uint32_t +"__VertSplit :vsplit will only show ' | ' +"__Visual Selected text looks like this diff --git a/vimrc b/vimrc @@ -25,6 +25,8 @@ set nobackup set undofile set undodir=$HOME/.vim/undo +set virtualedit=block " make visual blocks easier to understand + set tags+=~/.vim/systags " used for omnicompletion set path=.,,inc,src,/usr/include,/usr/local/include " improve vim path " }}} @@ -90,7 +92,7 @@ au FileType make set noet au Filetype html ab -- &mdash; au Filetype html ab </ </<C-X><C-o> au Filetype mail set tw=80 fdm=marker -au BufWritePost Xresources !xrdb % +au BufWritePost *Xresources !xrdb % au VimEnter * call ViewTips() set omnifunc=syntaxcomplete#Complete diff --git a/xinitrc b/xinitrc @@ -5,7 +5,7 @@ # Set wallpaper #hsetroot -solid \#333333 -hsetroot -tile ~/usr/img/bg/default.jpg +hsetroot -tile ~/usr/img/bg/default.jpg -brightness -0.2 # girl just wanna have fun #xantfarm -num 4 -air '#2c2c2c' -ant '#cdf318' -sand '#665847' & @@ -32,12 +32,16 @@ function wm() { # enable RGBA module for GTK # export GTK_MODULES=rgba - font='-*-gohufont-medium-*-*--11-*-*-*-*-*-iso10646-1' + #$1 & - while :; do date '+%H:%M'; sleep 60; done | - bar -f $font -B\#00000000 -b -g 30x10+1406+4 & + font='-*-stlarch-medium-*-*--10-*-*-*-*-*-*-*' + font="${font},-*-gohufont-medium-*-*--11-*-*-*-*-*-iso10646-1" + while :; do + ~/bin/mkbar + done | bar -f "$font" -B\#00000000 -b -g 800x20+320+2 & exec $1 + } function run() {