From 6c078729783f06751778241fc534b4515416fd63 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 6 Jan 2016 12:23:59 -0600 Subject: [PATCH] refactoring --- .gitignore | 1 + .../fonts.bash | 0 .../git.bash | 0 .../neovim.bash | 0 .../pacaur.bash | 0 .../shell.bash | 0 .../urxvt.bash | 0 arch_linux_init/utils.bash | 4 +++ de/arch_setup.bash => arch_linux_init/wm.bash | 0 .../xorg.bash | 0 link_all.bash | 31 +++++++++++++++++++ readme.md | 0 sh/bashrc | 15 +++++++-- variables.bash | 3 +- {de => wm}/bspwm_config | 0 {de => wm}/bspwmrc | 0 {de => wm}/link.bash | 0 {de => wm}/sxhkdrc | 0 x/link.bash | 10 ++++++ 19 files changed, 60 insertions(+), 4 deletions(-) rename fonts/arch_setup.bash => arch_linux_init/fonts.bash (100%) rename git/arch_setup.bash => arch_linux_init/git.bash (100%) mode change 100644 => 100755 rename vim/arch_setup.bash => arch_linux_init/neovim.bash (100%) rename aur/arch_setup.bash => arch_linux_init/pacaur.bash (100%) rename sh/arch_setup.bash => arch_linux_init/shell.bash (100%) rename term/arch_setup.bash => arch_linux_init/urxvt.bash (100%) create mode 100755 arch_linux_init/utils.bash rename de/arch_setup.bash => arch_linux_init/wm.bash (100%) rename x/arch_setup.bash => arch_linux_init/xorg.bash (100%) create mode 100755 link_all.bash create mode 100644 readme.md mode change 100644 => 100755 variables.bash rename {de => wm}/bspwm_config (100%) rename {de => wm}/bspwmrc (100%) rename {de => wm}/link.bash (100%) rename {de => wm}/sxhkdrc (100%) diff --git a/.gitignore b/.gitignore index 6f2c19e..b209927 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ colors/gen/vendor colors/gen/tmp +*.lock diff --git a/fonts/arch_setup.bash b/arch_linux_init/fonts.bash similarity index 100% rename from fonts/arch_setup.bash rename to arch_linux_init/fonts.bash diff --git a/git/arch_setup.bash b/arch_linux_init/git.bash old mode 100644 new mode 100755 similarity index 100% rename from git/arch_setup.bash rename to arch_linux_init/git.bash diff --git a/vim/arch_setup.bash b/arch_linux_init/neovim.bash similarity index 100% rename from vim/arch_setup.bash rename to arch_linux_init/neovim.bash diff --git a/aur/arch_setup.bash b/arch_linux_init/pacaur.bash similarity index 100% rename from aur/arch_setup.bash rename to arch_linux_init/pacaur.bash diff --git a/sh/arch_setup.bash b/arch_linux_init/shell.bash similarity index 100% rename from sh/arch_setup.bash rename to arch_linux_init/shell.bash diff --git a/term/arch_setup.bash b/arch_linux_init/urxvt.bash similarity index 100% rename from term/arch_setup.bash rename to arch_linux_init/urxvt.bash diff --git a/arch_linux_init/utils.bash b/arch_linux_init/utils.bash new file mode 100755 index 0000000..e923daa --- /dev/null +++ b/arch_linux_init/utils.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +sudo pacman -S the_silver_searcher --noconfirm + diff --git a/de/arch_setup.bash b/arch_linux_init/wm.bash similarity index 100% rename from de/arch_setup.bash rename to arch_linux_init/wm.bash diff --git a/x/arch_setup.bash b/arch_linux_init/xorg.bash similarity index 100% rename from x/arch_setup.bash rename to arch_linux_init/xorg.bash diff --git a/link_all.bash b/link_all.bash new file mode 100755 index 0000000..207d955 --- /dev/null +++ b/link_all.bash @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd) +source "$DIR/variables.bash" + +# Let user know that this script will delete their current configuration and +# that they should read this script before running. We'll use a lock file so +# the user only needs to agree once. +if [ -f "$DIR/agree_to_bootstrap.lock" ]; then + # User agreed already - do nothing + echo "Linking..." +else + echo "Running this script may delete existing personal configuration files." + echo "Please view this script's source, fully understand it, and backup any files" + echo "before continuing." + read -r -p "Are you sure you want to continue? [y/N] " response + response=${response,,} # to_lower + if [[ $response =~ ^(yes|y)$ ]]; then + touch "$DIR/agree_to_bootstrap.lock" + else + exit 1 + fi +fi + +source "$DOTFILES_PATH/colors/link.bash" +source "$DOTFILES_PATH/git/link.bash" +source "$DOTFILES_PATH/vim/link.bash" +source "$DOTFILES_PATH/sh/link.bash" +source "$DOTFILES_PATH/x/link.bash" +source "$DOTFILES_PATH/wm/link.bash" + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/sh/bashrc b/sh/bashrc index d5c32eb..545424c 100644 --- a/sh/bashrc +++ b/sh/bashrc @@ -4,9 +4,18 @@ BASE16_SHELL="$DOTFILES_PATH/colors/shell" [[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL" # filesystem aliases -alias l="ls --color=auto" -alias ll="ls -l --color=auto" -alias la="ls -la --color=auto" +alias lx='ls -lXB' # order by filetype +alias lk='ls -lSr' # order by filesize reversed +alias lt='ls -ltr' # order by file modified time +alias lc='ls -ltcr' # order by filectime +alias lu='ls -ltur' # order by file access time +alias ls='ls -h --color --group-directories-first' # flat view w/ directories first +alias l='ls -h --color --group-directories-first' # same as above +alias ll='ls -lv --group-directories-first' # non-flat view +alias lm='ll | more' +alias lr='ll -R' # please don't +alias la='ll -A' # show all +alias tree='tree -Csuh' # navigation aliases alias cd..="cd .." diff --git a/variables.bash b/variables.bash old mode 100644 new mode 100755 index 16f55b5..f76abf3 --- a/variables.bash +++ b/variables.bash @@ -1,6 +1,7 @@ #!/usr/bin/env bash -# This script will seriously nuke your home directory. You should really read each of the scripts that will be executed in those process. +# This script will seriously nuke your home directory. You should really read +# each of the scripts that will be executed in those process. DOTFILES_PATH=$HOME/.dotfiles REPOSITORY_PATH=$HOME/Documents/Repositories diff --git a/de/bspwm_config b/wm/bspwm_config similarity index 100% rename from de/bspwm_config rename to wm/bspwm_config diff --git a/de/bspwmrc b/wm/bspwmrc similarity index 100% rename from de/bspwmrc rename to wm/bspwmrc diff --git a/de/link.bash b/wm/link.bash similarity index 100% rename from de/link.bash rename to wm/link.bash diff --git a/de/sxhkdrc b/wm/sxhkdrc similarity index 100% rename from de/sxhkdrc rename to wm/sxhkdrc diff --git a/x/link.bash b/x/link.bash index 26839d8..5541269 100755 --- a/x/link.bash +++ b/x/link.bash @@ -8,3 +8,13 @@ rm "$HOME/.Xresources" ln -s "$HOME/.dotfiles/x/xinitrc" "$HOME/.xinitrc" ln -s "$HOME/.dotfiles/x/xresources" "$HOME/.Xresources" +xrdb "$HOME/.Xresources" + +if [ -f "$HOME/.Xresources.colors" ]; then + xrdb -merge "$HOME/.Xresources.colors" +fi + +if [ -f "$HOME/.Xresources.env" ]; then + xrdb -merge "$HOME/.Xresources.env" +fi +