[ "$PS1" ] || return
# Initialize keychain(1) ssh-agent and gpg-agent helper
-type keychain >/dev/null 2>&1 \
+type -t keychain >/dev/null \
&& eval `keychain --agents ssh --eval --quick --quiet`
# Common command aliases (1/2)
[ "$LOGNAME" = "root" ] \
&& PS1="${PS1}${COLOR_PROMPT_ROOT}\\\$${COLOR_RESET} " \
|| PS1="${PS1}${COLOR_PROMPT_USER}\\\$${COLOR_RESET} "
-[ "$(type __git_ps1)" ] \
+type -t __git_ps1 >/dev/null \
&& PS1="\$(__git_ps1 '(${COLOR_VCS}%s${COLOR_RESET}) ')${PS1}"
PS1="${chroot_name:+[${COLOR_CHROOT}$chroot_name${COLOR_RESET}] }${PS1}"
PS1="${COLOR_RESET}${PS1}"
alias "lasth"="last | head -n \`expr \\\$LINES - 2\`"
# Aliases for screen(1), if installed
-type screen >/dev/null 2>&1
+type -t screen >/dev/null
if [ $? -eq 0 ]; then
alias "s"="screen"
alias "sr"="screen -dr"
fi
# less(1) filter, if available
-type lesspipe >/dev/null 2>&1 \
+type -t lesspipe >/dev/null \
&& eval `lesspipe`
# Setup slrn(1) and cleanscore(1), if installed
-type cleanscore >/dev/null 2>&1 \
+type -t cleanscore >/dev/null \
&& alias slrn="cleanscore -f ~/.slrnscore && slrn"
# Enable color support of ls(1)
if [ "$TERM" != "dumb" ]; then
- type dircolors >/dev/null 2>&1 && eval `dircolors -b`
+ type -t dircolors >/dev/null && eval `dircolors -b`
ls --color / >/dev/null 2>&1
if [ $? -eq 0 ]; then
# "GNU style"
&& PATH=~/sbin:"${PATH}"
# Setup MANPATH, if manpath(1) isn't available
-if [ ! "$(type manpath 2>/dev/null)" ]; then
+if [ ! "$(type -t manpath 2>/dev/null)" ]; then
[ -z "$MANPATH" ] \
&& MANPATH="/usr/local/share/man:/usr/share/man:/usr/man"
path=""
[ "$PS1" ] || return
# validate terminal definition
-type tset >/dev/null 2>&1 && eval `tset -s -Q`
+type -t tset >/dev/null && eval `tset -s -Q`
# generic shell prompt
[ "$LOGNAME" = "root" ] \
# Reminders (once every 60 minutes)
if [ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]; then
[ -e ~/.ConfigScripts.debug ] && echo " - Reminders ..."
- type icalBuddy >/dev/null 2>&1
- if [ $? -eq 0 -a "$LOGNAME" != "root" ]; then
+ if [ "$(type -t icalBuddy >/dev/null)" -a "$LOGNAME" != "root" ]; then
# icalBuddy(1)
case "$LANG" in
*.UTF*) bul="•"; bul_imp="!"; sep="»"; ;;
unset bul bul_imp sep
else
# remind(1)
- type remind >/dev/null 2>&1
- if [ $? -eq 0 -a -r ~/.remind ]; then
+ if [ "$(type -t remind >/dev/null)" -a -r ~/.remind ]; then
remind -h -g -t5 ~/.remind | \
grep -v '^Reminders for ' | grep -v '^$'
[ $? -eq 0 ] && echo
# Check filesystem quotas
mount 2>/dev/null | grep quota >/dev/null 2>&1
if [ $? -eq 0 ]; then
- type quota >/dev/null 2>&1 && quota -q
+ type -t quota >/dev/null && quota -q
fi
# -eof-
# Clean up SSH agents, if running and not using keychain(1)
if [ $SSH_AGENT_PID ]; then
- type keychain >/dev/null 2>&1 || eval `ssh-agent -k`
+ type -t keychain >/dev/null || eval `ssh-agent -k`
fi
# Clear the console if it is a local terminal