diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/bash/aliases.sh | 59 | ||||
-rw-r--r-- | .config/bash/login.sh | 9 | ||||
-rw-r--r-- | .config/bash/logout.sh | 9 | ||||
-rw-r--r-- | .config/bash/rc.d/emacs.sh | 8 | ||||
-rw-r--r-- | .config/bash/rc.sh | 80 |
5 files changed, 165 insertions, 0 deletions
diff --git a/.config/bash/aliases.sh b/.config/bash/aliases.sh new file mode 100644 index 0000000..8241b95 --- /dev/null +++ b/.config/bash/aliases.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# The above line probably should never be *used* in this file, but it +# lets text editors know that this is BASH syntax. + +###################################################################### +# Set up colors and settings for ls/dir/vdir # +###################################################################### +if [ -x "`which dircolors`" ]; then + eval "`dircolors -b`" + alias ls='ls -1v --color=auto' + alias dir='dir -v --color=auto' + alias vdir='vdir -v--color=auto' + + for xgrep in ${PATH//:/\/*grep }/*grep; do + if [ -f "$xgrep" ]; then + xgrep=`basename "$xgrep"` + if [ "$xgrep" != pgrep ]; then + alias $xgrep="$xgrep --color=auto" + fi + fi + done +else + alias ls='ls -1v' + alias dir='dir -v' + alias vdir='vdir -v' +fi + +###################################################################### +# Set up the standard aliases for ls # +###################################################################### +alias ll='ls -l' +alias la='ls -a' +alias l='ls -CF' + +###################################################################### +# Some preferences for miscellaneous stuff # +###################################################################### +#alias rm='gvfs-trash' +alias ssh='ssh -XC' +alias sed='sed --follow-symlinks' +alias tree='tree --charset utf8' +alias cd=pushd +alias gitk='gitk --all --date-order' + +###################################################################### +# Remember lat/long for redshift # +###################################################################### +redshift='redshift -l39.9030:85.9979' +alias gtk-redshift="gtk-$redshift" +alias redshift="$redshift" +unset redshift + +###################################################################### +# Some almost-function aliases # +###################################################################### +xterm-title() { echo "];$@"; } # Oh, wait this one *is* a function +alias lock="clear; away -C 'This terminal is locked'" +alias plock="xterm-title Terminal Locked;lock" +mvln() { mv $1 $2; ln -s $2 $1; } diff --git a/.config/bash/login.sh b/.config/bash/login.sh new file mode 100644 index 0000000..1269a03 --- /dev/null +++ b/.config/bash/login.sh @@ -0,0 +1,9 @@ +# ~/.bash_login: executed by bash(1) when login shell starts. + +# I think this is sane default behavior + +# Load user settings +. "$HOME/.profile" + +# Load bash settings (automatic for non-login shells) +. "$HOME/.bashrc" diff --git a/.config/bash/logout.sh b/.config/bash/logout.sh new file mode 100644 index 0000000..a8b88c1 --- /dev/null +++ b/.config/bash/logout.sh @@ -0,0 +1,9 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi + +make -C "$HOME" diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh new file mode 100644 index 0000000..f484bbb --- /dev/null +++ b/.config/bash/rc.d/emacs.sh @@ -0,0 +1,8 @@ +case "$TERM" in + eterm*) + SELECTED_EDITOR='emacsclient' + EDITOR=$SELECTED_EDITOR + VISUAL=$SELECTED_EDITOR + export SELECTED_EDITOR EDITOR VISUAL + :;; +esac diff --git a/.config/bash/rc.sh b/.config/bash/rc.sh new file mode 100644 index 0000000..ed55f75 --- /dev/null +++ b/.config/bash/rc.sh @@ -0,0 +1,80 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# I include this file for all interactive invocations of bash(1), whether +# they are login shells or not. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. See bash(1) for more options +export HISTCONTROL=ignoredups +export HISTFILE=${XDG_CACHE_HOME}/bash/history +export HISTTIMEFORMAT='[%Y-%m-%d %H:%M] ' +shopt -s histappend # append to the history file, don't overwrite it + +shopt -s checkwinsize # update the values of LINES and COLUMNS +shopt -s globstar # Let ** recursively scan directories + +# Why is this not on by default? +# "We have a cached value, but it isn't valid anymore. Should we trash it?" +shopt -s checkhash + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x "`which lesspipe 2>/dev/null`" ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +make_prompt() { + local RESET='' + local BOLD='' + local GREEN='' + local BLUE='' + if $1; then + RESET="$(tput sgr0)" + BOLD="$(tput bold)" + GREEN="$(tput setaf 2)" + BLUE="$(tput setaf 4)" + fi + local CHROOT='${debian_chroot:+($debian_chroot)}' + echo "${RESET}${BOLD}${CHROOT}${GREEN}"'\u@\h'"${RESET}:${BOLD}${BLUE}"'\w'"${RESET}" +} + +if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + PS1="$(make_prompt true )"'\n\$ ' +else + PS1="$(make_prompt false)"'\n\$ ' +fi + +# If this is an xterm set the title to user@host:dir +case "$TERM" in + xterm*|rxvt*) + PS1="\[\e]0;$(make_prompt false)\a\]$PS1";; +esac + +unset make_prompt + +# Include modular config files +if [ -d "${XDG_CONFIG_HOME}/rc.d" ]; then + for file in "${XDG_CONFIG_HOME}/rc.d"/*.sh; do + . "$file" + done +fi + +if [ -f ${XDG_CONFIG_HOME}/bash/aliases.sh ]; then + . ${XDG_CONFIG_HOME}/bash/aliases.sh +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi |