Bash, Python, IPython scripts, and userspace configuration https://westurner.org/dotfiles/
Shell Python Other Makefile Vim script CSS Other
Latest commit dd36c92 Dec 18, 2015 @westurner DOC: LICENSE: orgname: @westurner.org
* Correcting a historical inaccuracy.
* I heretofore correct "pyline" to "@westurner.org".
Permalink
Failed to load latest commit information.
debian BLD,TST,DOC,ENH: Settings, Makefile, setup.py, i3, bootstrap.sh script May 8, 2014
docs DOC: venv.rst: cdhelp | pbcopy > .. code:: bash Dec 1, 2015
etc ENH: etc/i3/config: Start gnome-settings-daemon (e.g. for anti-aliasing) May 1, 2015
requirements DOC,BLD: remove github-tools Oct 27, 2014
scripts DOC: autogenerated usage docs May 1, 2015
src REF,BUG: CONDA_ENVS_PATH, _setup_venv_prompt, _virtualenvwrapper_get_… Apr 29, 2015
tests TST: TODO Dec 27, 2014
.gitignore CLN: .gitignore: .DS_Store Nov 15, 2014
.hgignore BLD,BUG: remove MANIFEST.in from .hgignore May 24, 2014
.hgtags Added tag osx_master for changeset 267b5cd3fb0b Aug 23, 2014
.travis.yml BLD,TST: update .travis.yml: add cache: apt May 21, 2014
CHANGELOG.rst RLS: CHANGELOG.rst: v0.8.2 May 1, 2015
LICENSE DOC: LICENSE: orgname: @westurner.org Dec 18, 2015
MANIFEST.in RLS: MANIFEST.in: autogenerated git_manifest May 1, 2015
Makefile BLD: Makefile: pip install -r ./docs/requirements.txt May 1, 2015
README.rst DOC: README.rst: remove :ref: roles, reformat links Apr 25, 2015
VERSION.txt RLS: VERSION.txt: 0.8.2 May 1, 2015
buildout.cfg Importing dotfiles packaging Oct 12, 2011
requirements-all.txt BUG,TST,BLD,DOC: make tests pass Dec 27, 2014
requirements.txt BLD: tox.ini: +pip, requirements.txt: +#comments Dec 27, 2014
runtests.py BLD,TST,DOC,ENH: Settings, Makefile, setup.py, i3, bootstrap.sh script May 8, 2014
setup.cfg Adding blank setup.cfg and removing auto-generated MANIFEST.in Nov 22, 2011
setup.py WIP: usrlog.sh, venv ~rewrite Nov 23, 2014
tox.ini BLD: tox.ini: +pip, requirements.txt: +#comments Dec 27, 2014

README.rst

Dotfiles

GitHub | Documentation | ReadTheDocs

https://travis-ci.org/westurner/dotfiles.svg?branch=master

Goals

  • Streamline frequent workflows
  • Configure Bash, ZSH, and Vim
  • Configure Python, pip, virtualenv, virtualenvwrapper
  • Configure IPython
  • Configure Gnome
  • Configure i3wm
  • Support Debian Linux, Ubuntu Linux, OSX
  • Document commands and keyboard shortcuts
  • Create a productive working environment

Installation

Requirements

Project requirements are installed by bootstrap_dotfiles.sh and/or, optionally, also a Makefile.

  • Bash, Git, Python, pip

Install the dotfiles

The bootstrap_dotfiles.sh shell script:

  • clones the dotfiles and dotvim repositories
  • creates symlinks from HOME to __DOTFILES,
  • installs the dotfiles Python package,
  • installs additional requirements with pip
wget bootstrap_dotfiles.sh
bash ./scripts/bootstrap_dotfiles.sh -I -R

Create a virtualenv with virtualenvwrapper named "dotfiles":

# Install virtualenvwrapper
pip install virtualenvwrapper   # apt-get install python-virtualenvwrapper
source $(which 'virtualenvwrapper.sh')    # 07-bashrc.virtualenvwrapper.sh

export WORKON_HOME="~/-wrk/-ve27"                    # __WRK/-ve python2.7
mkdir -p $WORKON_HOME

# Create a virtualenvwrapper virtualenv
mkvirtualenv dotfiles  # workon dotfiles
mkdir $VIRTUAL_ENV/src
cd $VIRTUAL_ENV/src

# Clone the dotfiles git repository
branch="master"     # stable
# branch="develop"  # development
git clone ssh://git@github.com/westurner/dotfiles -b ${branch}
cd dotfiles

# Install dotfiles pkg, symlinks, and extra pip requirements
scripts/bootstrap_dotfiles.sh -I -R         # -I calls -S

With Python builds that haven't set a prefix which is writeable by the current user, you can also install into ~/.local with pip --user:

# (Optional) Also install pkg and reqs into ~/.local/bin (pip --user)
# scripts/bootstrap_dotfiles.sh -I -R -u

Note

See Quickstart, which uses venv-style paths.

Source the dotfiles

  • Bash (and ZSH) configuation sets are sequentially numbered 00-99.

    00-bashrc.before.sh sources a documented, numerically sequential sequence of bash scripts.

  • ZSH loads much of the standard Bash configuration and oh-my-zsh.

    00-zshrc.before.sh

  • bootstrap_dotfiles.sh -S installs dotfiles ${__DOTFILES} symlinks.

    ln -s ~/-dotfiles/etc/.bashrc ~/.bashrc
    ln -s ~/-dotfiles/etc/.zshrc ~/.zshrc
# Source the dotfiles
source ~/.bashrc                                         # source ~/.zshrc

# source ${__DOTFILES}/etc/.bashrc
## source ${__DOTFILES}/etc/bash/00-bashrc.before.sh     # dotfiles_reload
### dotfiles configuration sequence                # (\d\d)-bashrc.(.*).sh
#### source ${__DOTFILES}/etc/bash/99-bashrc.after.sh
##### source ${__PROJECTSRC}                     # ${__WRK}/.projectsrc.sh

# print venv configuration
dotfiles_status
ds
Last login: Tue Dec  2 15:01:56 on ttys000
#
# dotfiles_reload()
#ntid  _TERM_ID="#SElGeTf5VcA"  #_USRLOG="/Users/W/-usrlog.log"
# dotfiles_status()
HOSTNAME='nb-mb1'
USER='W'
__WRK='/Users/W/-wrk'
PROJECT_HOME='/Users/W/-wrk'
WORKON_HOME='/Users/W/-wrk/-ve'
VIRTUAL_ENV_NAME=''
VIRTUAL_ENV=''
_SRC=''
_APP=''
_WRD=''
_USRLOG='/Users/W/-usrlog.log'
_TERM_ID='#SElGeTf5VcA'
PATH='/Users/W/.local/bin:/Users/W/-dotfiles/scripts:/usr/sbin:/sbin:/bin:/usr/local/bin:/usr/bin:/opt/X11/bin:/usr/local/git/bin'
__DOTFILES='/Users/W/-dotfiles'
#
# cd /
#SElGeTf5VcA W@nb-mb1:/
$
$ stid 'dotfiles'
#stid  _TERM_ID="dotfiles"  #_TERM_ID__="dotfiles install"  #_USRLOG="/Users/W/-usrlog.log"
# stid 'dotfiles'
dotfiles W@nb-mb1:/
$

Upgrade the dotfiles

# check for any changes to symlinked dotfiles
cdd                                                   # cddotfiles
git status && git diff                                # gsi ; gitw diff

# pull and upgrade dotfiles and dotvim
scripts/bootstrap_dotfiles.sh -U

Quickstart

This is a verbose example of installing and working with a VIRTUAL_ENV in WORKON_HOME named "dotfiles".

See Install the dotfiles for more terse installation instructions.

# clone and install dotfiles and dotvim
# with venv-style paths (_SRC, _APP, _WRD)

# __WRK             -- base path for workspace               [venv]
__WRK="$HOME/-wrk"
cd $__WRK                     # cdwrk                        [venv]

# WORKON_HOME       -- path to virtualenv dirs  [virtualenvwrapper]
WORKON_HOME="${__WRK}/-ve27"  # ~/-wrk/-ve27
test -d ${WORKON_HOME} || mkdir -p ${WORKON_HOME}
cd $WORKON_HOME               # cdworkonhome cdwh cdve       [venv]

# VIRTUAL_ENV_NAME  -- basename for VIRTUAL_ENV              [venv]
VIRTUAL_ENV_NAME="dotfiles"

# VIRTUAL_ENV       -- current virtualenv path         [virtualenv]
VIRTUAL_ENV="${WORKON_HOME}/${VIRTUAL_ENV_NAME}"
cd $VIRTUAL_ENV               # cdv cdvirtualenv [venv, virtualenvwrapper]

# _SRC              -- basepath of source repositories (e.g. for pip)
_SRC="${VIRTUAL_ENV}/src"
cd $_SRC                      # cdsrc cds                    [venv]

# _APP              -- basename of current working directory [venv]
_APP="dotfiles"

# _WRD              -- working directory path                [venv]
_WRD="${_SRC}/${_APP}"        # cdwrd cdw                    [venv]

git clone https://github.com/westurner/dotfiles $_WRD
git clone https://github.com/westurner/dotvim ${_WRD}/etc/vim
cd $_WRD                      # cdwrd cdw                    [venv]

# __DOTFILES        -- symlink root for current dotfiles     [venv]
__DOTFILES="${HOME}/-dotfiles"
ln -s $_WRD $__DOTFILES
ls ~/-dotfiles
cd $__DOTFILES                # cddotfiles cdd               [venv]

## Install the dotfiles
$_WRD/scripts/bootstrap_dotfiles.sh -h      # help
$_WRD/scripts/bootstrap_dotfiles.sh -I      # or: make install
$_WRD/scripts/bootstrap_dotfiles.sh -S      # or: make install_symlinks

For further documentation, see:

Further Dotfiles Resources