# $FreeBSD$## .cshrc.mine - csh resource script, read at beginning of execution by each shell## see also csh(1), environ(7).# more examples available at /usr/share/examples/csh/## few aliases I like to have#alias sum 'cksum /usr/local/share/certs/ca-root-nss.crt | sort | diff sum.txt -'alias tm tmux attachalias vim vi# Tab completion and - correctionif ($?prompt) then set autocorrect = ambiguous set complete = enhance set correct = cmdendif# some extra program completionscomplete sysctl 'n/*/`sysctl -Na`/'complete man 'p,*,c,'# BSD is functional but pretty colorless, let's change that# Let 'ls' have some colorsetenv CLICOLOR yes# Basic colorsset red="%{\033[1;31m%}"set green="%{\033[0;32m%}"set blue="%{\033[1;34m%}"set yellow="%{\033[1;33m%}"set magenta="%{\033[1;35m%}"set cyan="%{\033[1;36m%}"set white="%{\033[0;37m%}"set end="%{\033[0m%}"# Colored promptset prompt="${cyan}%n${red}@%m ${white}%~ ${cyan}%%${end} "# Colored man pages, I dislike the undelining of everything..setenv LESS_TERMCAP_mb `echotc md; echotc AF 4`setenv LESS_TERMCAP_md `echotc md; echotc AF 4`setenv LESS_TERMCAP_me `echotc me`setenv LESS_TERMCAP_se `echotc me`setenv LESS_TERMCAP_so `echotc md; echotc AF 1; echotc AB 4`setenv LESS_TERMCAP_ue `echotc me`setenv LESS_TERMCAP_us `echotc md; echotc AF 2`# Unset used colorsunset red green blue yellow magenta cyan white end
set -g default-terminal "screen-256color"# interval is up to you, but it may use precious cpu time if set to 1set-option -g status-interval 30set-option -g status-right-length 60set-option -g status-left-length 120set -g status-bg colour237set -g status-fg colour237set -g mouse onset -g status-left '#[fg=blue] #(hostname -s) #[fg=colour41]*#[fg=blue] #(sh bin/tmx temp)C #[fg=colour41]* #[fg=blue]#(sh bin/tmx mem) #[fg=colour41]* #[fg=blue]#(sh bin/tmx sum) 'set -g status-right '#[fg=blue]#(sh bin/tmx avg)#[fg=colour41]* #[fg=blue]%H:%M'# Attach a running session or create a fresh onenew-session -n $HOST
#!/bin/shset -xetemp () { var1=$(sysctl -n dev.cpu.0.temperature | awk '{printf "%3.0f\n",$1}') var2=$(sysctl -n dev.cpu.1.temperature | awk '{printf "%3.0f\n",$1}') echo "scale=1; ($var1 + $var2) / 2" | bc}mem () { mem_real=$(sysctl -n hw.realmem) pagesize=$(sysctl -n hw.pagesize) inact_count=$(sysctl -n vm.stats.vm.v_inactive_count) free_count=$(sysctl -n vm.stats.vm.v_free_count) mem_inact=$(printf "%s\\n" "$inact_count *$pagesize" | bc) mem_free=$(printf "%s\\n" "$free_count * $pagesize" | bc) mem_avail=$(printf "%s\\n" "$mem_inact + $mem_free" | bc) mem_used=$(printf "%s\\n" "$mem_real - $mem_avail" | bc) printf "%s\\n" "$(("$mem_used * 100 / $mem_real"))"% exit 0}avg () { sysctl -n vm.loadavg | sed 's/{//g;s/}//g'}sum () { if [ "$(cksum /usr/local/share/certs/ca-root-nss.crt | \ awk '{printf "%-1s %s\n", $1 , $2}')" \ != "$(awk '{printf "%-1s %s\n", $1 , $2}' ~/sum.txt)" ]; then echo nss-mismatch fi}if [ "$1" = temp ]; then tempelif [ "$1" = mem ]; then memelif [ "$1" = avg ]; then avgelif [ "$1" = sum ]; then sumelse printf "Usage: sh tmx (temp mem or avg) \\n"fiexit 0