dots

git clone git://mattcarlson.org/repos/dots.git
Log | Files | Refs

mkshrc (855B)


      1 #!/bin/sh
      2 #
      3 # mkshrc
      4 
      5 if ! command -v pfetch >/dev/null; then pfetch() { :; }; fi
      6 
      7 pfetch
      8 
      9 COL0='\x1b[0;30m'
     10 COL1='\x1b[0;31m'
     11 COL2='\x1b[0;32m'
     12 COL3='\x1b[0;33m'
     13 COL4='\x1b[0;34m'
     14 COL5='\x1b[0;35m'
     15 COL6='\x1b[0;36m'
     16 COL7='\x1b[0;37m'
     17 COL8='\x1b[1;30m'
     18 COL9='\x1b[1;31m'
     19 COL10='\x1b[1;32m'
     20 COL11='\x1b[1;33m'
     21 COL12='\x1b[1;34m'
     22 COL13='\x1b[1;35m'
     23 COL14='\x1b[1;36m'
     24 COL15='\x1b[1;37m'
     25 BOLD='\x1b[1m'
     26 NORMAL='\x1b[0m'
     27 
     28 # prompt
     29 # bashism required b/c mksh doesn't support param expansion for PS1
     30 PS1=$'$(printf '%b' "${COL10}${PWD} $ ${NORMAL}")'
     31 export PS1
     32 
     33 # gpg tty
     34 GPG_TTY="$(tty)"
     35 export GPG_TTY
     36 
     37 # aliasrc
     38 [ -f "${XDG_CONFIG_HOME:-${HOME}/.config/}/sh/aliasrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config/}/sh/aliasrc"
     39 
     40 # functionrc
     41 [ -f "${XDG_CONFIG_HOME:-${HOME}/.config/}/sh/functionrc" ] && . "${XDG_CONFIG_HOME:-${HOME}/.config/}/sh/functionrc"