Skip to content

My custom Linux environment

On every machine that I install, I need a custom environment. At the very basic, I need screen and bash customizations. I will attempt to keep this blog post up-to-date with my most recent config.

/etc/bash.bashrc_halfgaar (naming scheme depends on distro):

function prompt_command {
  local XTERM_TITLE="\e]2;\u@\H:\w\a"
 
  local BGJOBS_COLOR="\[\e[1;30m\]"
  local BGJOBS=""
  if [ "$(jobs | head -c1)" ]; then BGJOBS=" $BGJOBS_COLOR(bg:\j)"; fi
 
  local DOLLAR_COLOR="\[\e[1;32m\]"
  if [[ ${EUID} == 0 ]] ; then DOLLAR_COLOR="\[\e[1;31m\]"; fi
  local DOLLAR="$DOLLAR_COLOR\\\$"
 
  local USER_COLOR="\[\e[1;32m\]"
  if [[ ${EUID} == 0 ]]; then USER_COLOR="\[\e[41;1;32m\]"; fi
 
  PS1="$XTERM_TITLE$USER_COLOR\u\[\e[1;32m\]@\H:\[\e[m\] \[\e[1;34m\]\w\[\e[m\]\n\
$DOLLAR$BGJOBS \[\e[m\]"
}
export PROMPT_COMMAND=prompt_command
 
export EDITOR=vim
 
alias ls='ls --color=auto'
alias ll='ls -l'
alias lh='ls -lh'
alias grep='grep --color=auto'

Don’t forget to source the file in ~/.bashrc

~/.screenrc:

caption always "%{= kB}%-Lw%{=s kB}%50>%n%f* %t %{-}%+Lw%<"
vbell off
startup_message off
term linux

    No Comments ( Add comment / trackback )

    Post a comment

    (required)
    (required)

    Your email is never published nor shared.

    (optional)
    Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>