dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

.profile (2828B)


      1 #!/bin/sh
      2 : ${XDG_ROOT:=$HOME}
      3 
      4 set -a
      5 # XDG
      6 XDG_CONFIG_HOME="$XDG_ROOT/.config"
      7 XDG_DATA_HOME="$XDG_ROOT/.local/share"
      8 XDG_CACHE_HOME="$XDG_ROOT/.cache"
      9 XDG_STATE_HOME="$XDG_ROOT/.local/state"
     10 
     11 ABDUCO_SOCKET_DIR="$XDG_STATE_HOME"/abuco
     12 HISTFILE="$XDG_STATE_HOME"/history
     13 LESSHISTFILE="$XDG_STATE_HOME"/lesshst
     14 
     15 # Global programs
     16 BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
     17 DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
     18 ELINKS_CONFDIR="$XDG_CONFIG_HOME/elinks"
     19 INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc
     20 LESSHISTFILE=-
     21 LYNX_CFG="$XDG_CONFIG_HOME/lynx/lynx.cfg"
     22 LYNX_LSS="$XDG_CONFIG_HOME/lynx/lynx.lss"
     23 NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch/config"
     24 NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
     25 NPM_CONFIG_PREFIX="~/.local/share/npm"
     26 PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel
     27 PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"
     28 PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"
     29 PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc"
     30 SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
     31 TASKRC="$XDG_CONFIG_HOME/task/taskrc"
     32 WGETRC="$XDG_CONFIG_HOME/wgetrc"
     33 XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
     34 #XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc
     35 
     36 BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
     37 CARGO_HOME="$XDG_DATA_HOME"/cargo
     38 FFMPEG_DATADIR="$XDG_DATA_HOME"/ffmpeg
     39 GEM_HOME="$XDG_DATA_HOME"/gem
     40 GNUPGHOME="$XDG_DATA_HOME/gnupg"
     41 GOPATH="$XDG_DATA_HOME"/go
     42 GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
     43 MACHINE_STORAGE_PATH="$XDG_DATA_HOME"/docker-machine
     44 MYSQL_HISTFILE="$XDG_DATA_HOME/mysql_history"
     45 NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
     46 PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
     47 RUSTUP_HOME="$XDG_DATA_HOME"/rustup
     48 SONGDL_HOME="${XDG_DATA_HOME}/music/"
     49 SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history"
     50 VSCODE_PORTABLE="$XDG_DATA_HOME/vscode"
     51 W3M_DIR="$XDG_DATA_HOME"/w3m
     52 _Z_DATA="$XDG_DATA_HOME/z"
     53 
     54 BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
     55 GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem
     56 NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages
     57 PSQL_HISTORY="$XDG_CACHE_HOME/pg/psql_history"
     58 
     59 # Local executables
     60 PATH=${PATH}:${HOME}/.local/bin:${HOME}/.local/bin/sh:${XDG_DATA_HOME}/npm/bin:${XDG_DATA_HOME}/.cargo/bin:${GOPATH}/bin:${XDG_DATA_HOME}/gem/bin
     61 
     62 # Setup editor
     63 # TODO until I grok the shell and able to control the clipboard and
     64 # registers with terminal level keybings. I am not going back to vi/nvi
     65 #alias vim=vi
     66 #alias nvim=vi
     67 {
     68 command -v vim && VISUAL=vim && EDITOR=vim
     69 } >/dev/null
     70 
     71 FUZZER=$(command -v fzy)
     72 
     73 BROWSER=lynx
     74 SURFRAW_browser="$BROWSER"
     75 
     76 # Theme
     77 # Hyper Red
     78 LESS_TERMCAP_so=$'\e[31m'
     79 LESS_TERMCAP_se=$'\e[0m'
     80 CLICOLOR=1
     81 LSCOLORS="xxexcxdxbxegxdxbagxcxd"
     82 LS_COLORS="di=0:ln=34:so=32:pi=33:ex=31:bd=34;46:cd=0;43:su=0;41:sg=30;46:tw=0;42:ow=0;43"
     83 
     84 set +a
     85 
     86 # Make `history` print timestamp
     87 HISTTIMEFORMAT="%F %T "
     88 HISTCONTROL=erasedups
     89 
     90 . "${XDG_CONFIG_HOME}/sh/functions"
     91 [ -f "${XDG_CONFIG_HOME}/sh/unstaged" ] && . "${XDG_CONFIG_HOME}/sh/unstaged"
     92