# -*- shell-script -*- ## Ensure sanity set +h umask 022 ## We live in a unicode world now LANG=en_AU.UTF-8 LC_CTYPE=en_AU.UTF-8 ## PATH # The wrappers directory must be the first entry in the PATH, and # /tools/bin should be last. # # Once you are no longer needing or using the tools dir you can remove # it from the PATH. #PATH=/usr/lib/pkgusr:/usr/bin:/usr/X11R6/bin:/opt/qt/bin:/tools/bin PATH=/usr/lib/pkgusr:/usr/bin:/usr/X11R6/bin:/opt/qt/bin ## A couple things to make less(1) nicer. LESS='-FgiMrswX --use-color' LESSCHARSET=utf-8 LESSOPEN='|lesspipe.sh %s' ## Timezone -- set to your local zone TZ='Australia/Brisbane' ## QT QTDIR=/opt/qt ## pkg-config _XORG=/usr/X11R6/lib/pkgconfig:/usr/X11R6/share/pkgconfig _KDE=/opt/kde/lib/pkgconfig _QT=${QTDIR}/lib/pkgconfig _PKGCFG=$(pkg-config --variable pc_path pkg-config) PKG_CONFIG_PATH=${_PKGCFG}:${_XORG}:${_KDE}:${_QT} # unset the tmp vars unset _XORG _KDE _QT _PKGCFG ## Locale directory suppression. # If this is set to `1' (one) then the install and mkdir wrappers # won't put anything in /usr/share/locale. Technically, the mkdir # wrapper still creates the dir, but it is removed afterward. If # you want to override this behaviour globally, set this to `0' # (zero) here, or you can override an individual package by adding # `SUPPRESSLOCALEDIR=0' to that pkgusr's ~/.pkgusrrc. # # See the comments in the install wrapper for more detail and # rationale. SUPPRESSLOCALEDIR=1 ## Build script update checks # If this is set to `1' (one) a check is done to see if there is a # newer build script available that the pkgusr could update to. If an # update is available a message is printed to stdout with instructions # of how to proceed. # # Override this in ~/.pkgusrrc. CHECKUPDATES=1 ## Slackware PKG local repo # Having a shortcut to a local Slackware PKG repo is very useful. # Pat Volkerding and his team are of a minority who actually know # what they are doing. I always check Slackware for patches. # # I get the Slack source via rsync. # See https://mirrors.slackware.com/mirrorlist/ # SLACKPKG=/home/steve/download/Slackware/slackware64-current/source # Obviously edit to suit your situation ## Export everything export LANG LC_CTYPE PATH LESS LESSCHARSET LESSOPEN TZ PKG_CONFIG_PATH QTDIR export SUPPRESSLOCALEDIR CHECKUPDATES SLACKPKG ## Bash Prompt # Shell prompts are not just eye-candy they should show what you need # to know most and they should do it in such a way that you don't # even notice. This sets up a two-line prompt that reminds you that # you're currently logged in as a pkgusr, which pkgusr, which group # if that pkgusr has multiple groups and you've newgrp'd, if you're # inside a git repo display the branch and other pertinent info, if # the previous command had a non-zero exit display the code, display # the current time, and current working directory (truncated to # prevent "prompt-creep"). Colourised so that often you won't even # need to read it to take in the info. # Colours (doesn't include black (30)) CO="\[\e[0m\]" # Colour Off RED="\[\e[0;31m\]" # Red GRN="\[\e[0;32m\]" # Green YEL="\[\e[0;33m\]" # Yellow BLU="\[\e[0;34m\]" # Blue MAG="\[\e[0;35m\]" # Magenta CYN="\[\e[0;36m\]" # Cyan WTE="\[\e[0;37m\]" # White # Bold (bright) BRED="\[\e[1;31m\]" # Bold Red BGRN="\[\e[1;32m\]" # Bold Green BYEL="\[\e[1;33m\]" # Bold Yellow BBLU="\[\e[1;34m\]" # Bold Blue BMAG="\[\e[1;35m\]" # Bold Magenta BCYN="\[\e[1;36m\]" # Bold Cyan BWTE="\[\e[1;37m\]" # Bold White # Some pkgusrs may use extra groups so the prompt should reflect that. # This function adds the group name to the prompt if necessary. _sg() { [[ $(id -gn) != $(id -un) ]] && echo "$WTE:$CYN$(id -gn)" } # This function, called from $PROMPT_COMMAND, puts all the pieces of # the prompt together. make_prompt() { rc=$? # Return code from previous cmd [[ $rc -gt 0 ]] && prc="$BWTE[$BRED$rc$BWTE] " || prc= local sg gitp p # Using a subgroup sg=$(_sg) # Git [[ -f /etc/pkgusr/git-prompt ]] && gitp=$(__git_ps1) || gitp= p="pkgusr" # Build up the PS1 PS1="$BWTE[$WTE$p $BWTE($CYN\u$sg$BWTE)]" # [pkgusr (usr:grp)] PS1+="$CO" # reset to not mess up git prompt PS1+="$gitp" # (gitstuff) PS1+="\n$prc$BYEL\A$WTE:$BMAG\w$BWTE>$CO " # [rc]TIME:CWD> } # The git goodies [[ -f /etc/pkgusr/git-prompt ]] && source /etc/pkgusr/git-prompt GIT_PS1_SHOWDIRTYSTATE=true GIT_PS1_SHOWSTASHSTATE=true GIT_PS1_SHOWUNTRACKEDFILES=true GIT_PS1_SHOWUPSTREAM=auto GIT_PS1_DESCRIBE_STYLE=branch GIT_PS1_SHOWCOLORHINTS=true # So the prompt doesn't fly off the right-hand edge of the screen # when you're down a long directory tree. PROMPT_DIRTRIM=4 # Finally, make the prompt happen! PROMPT_COMMAND=make_prompt ## Pretty colours for ls eval $(dircolors -b) alias ls='ls --color=always -Fb' ## Suck in some handy shell functions . /etc/pkgusr/handy_funcs ## Go to the home directory whenever we su to a package user. cd ## Setup the git config if needed if [[ ! -d ${HOME}/.config/git && -f ${HOME}/.gitconfig ]]; then prep_git fi ## Bash Completion if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion fi ## Per-user settings # Called last so that defaults can be overridden. [[ -f ${HOME}/.pkgusrrc ]] && . ${HOME}/.pkgusrrc ###===============================================================### # Don't put anything below here unless it relies on something being # # set in ~/.pkgusrrc # ###===============================================================### # Maybe check if the build script can be updated, but not on dumb # terms so that TRAMP still works. if [ ${CHECKUPDATES} -eq 1 -a "$TERM" != "dumb" ]; then checkupdates fi # Local variables: # sh-basic-offset: 4 # End: