From Electron Cloud
Jump to: navigation, search
(New page: My usual aliases: <pre> alias cdp='cd project-dir' alias cdb='cd project-binary-dir' alias cdl='cd /var/log' alias iw='watch "iwconfig wlan0; ifconfig wlan0; ps aux | grep dhcp | grep -v g...)
(No difference)

Revision as of 15:52, 10 March 2009

My usual aliases:

alias cdp='cd project-dir'
alias cdb='cd project-binary-dir'
alias cdl='cd /var/log'
alias iw='watch "iwconfig wlan0; ifconfig wlan0; ps aux | grep dhcp | grep -v grep"'
alias ko='killall -9 "binary1" "binary2" etc'
alias l='ls -F'
alias ll='ls -la'
alias lt='ls -ltr'
alias pow='cat /proc/acpi/battery/BAT1/info | grep last | cat - /proc/acpi/battery/BAT1/state /proc/acpi/thermal_zone/THRM/temperature'
alias rxvt='rxvt -sr -bg black -fg white -geometry 80x60 -sl 10000'

Bash prompt (yellow for "foreign" systems):

# prompt
case $TERM in
    xterm*)
        TITLEBAR='\[\033]0;\u@\h:\w\007\]'
        ;;
    *)
        TITLEBAR=''
        ;;
esac

        BLUE="\[\033[0;34m\]"
  LIGHT_GRAY="\[\033[0;37m\]"
 LIGHT_GREEN="\[\033[1;32m\]"
  LIGHT_BLUE="\[\033[1;34m\]"
  LIGHT_CYAN="\[\033[1;36m\]"
      YELLOW="\[\033[1;33m\]"
       WHITE="\[\033[1;37m\]"
         RED="\[\033[0;31m\]"
    NO_COLOR="\[\033[0m\]"

PS1="${TITLEBAR}\n\
$LIGHT_CYAN\w$NO_COLOR\n\
[$RED\h$NO_COLOR][$YELLOW\$(date +%r)$NO_COLOR] \
"
PS2='> '
PS4='+ '

Below is a script for an upper-right console clock. It can be called bgclock but I don't know the best way to make it put itself into the background. Could use raw ANSI codes rather than tput, but I'm lazy.

#!/bin/sh
while [ 1 ]
do
        COLS=$((`tput cols` - 8))
        tput sc; tput cup 0 $COLS; date +%H:%M:%S; tput rc
        sleep 1
done