1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-22 03:21:30 +01:00

cleanup documentation/install script

This commit is contained in:
bretello 2020-12-06 01:32:04 +01:00
parent 7f053fcb8e
commit da3b5628ad
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
3 changed files with 27 additions and 47 deletions

View File

@ -57,22 +57,6 @@ by the install script. The self-update routine can be called manually by calling
If you do not want to run the installer script, you can just add source `brethil_dotfile.sh`
in your `.zshrc`. This requires antibody installed.
### Installed
1. `antibody`: zsh plugin manager
- `oh-my-zsh`
- `oh-my-zsh` zsh themes: `brethil` and `brethil-minimal`.
2. (amix's awesome vimrc)[https://www.github.com/amix/vimrc]: A quite nice vim rc.
3. `byobu`: wrapper/config for tmux, a screen multiplexer
4. `grc`/`ccze`: output colorizers, can color the output of any command, usage:
grc <cmd>
<cmd> | ccze
5. `bmon`: bandwidth monitor, shows graphs for bandwith usage
6. `mtr`: my traceroute, traceroute+ping network utility
7. `htop`: better top
### Available Functions
0. `cheat`: show cheat sheet for commands using cheat.sh (`cheat <commandname>`)

View File

@ -1,5 +1,5 @@
# Check for update, set DISABLE_UPDATE_PROMPT=yes to disable the prompt and automatically update
env DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT DOTFILES=$DOTFILES zsh -f $DOTFILES/check_for_update.sh
env DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT DOTFILES="$DOTFILES" zsh -f "$DOTFILES/check_for_update.sh"
# theme-related variables
export ZSH_THEME="brethil"
@ -8,12 +8,12 @@ export VIRTUAL_ENV_DISABLE_PROMPT=true
# Source all other plugins
source <(antibody init)
export ZSH=$(antibody path robbyrussell/oh-my-zsh)
antibody bundle < $DOTFILES/antibody_plugins.txt
export ZSH="$(antibody path robbyrussell/oh-my-zsh)"
antibody bundle < "$DOTFILES/antibody_plugins.txt"
uname="$(uname -a)"
if [[ $uname == *"ARCH"* || $uname == *"MANJARO"* ]]; then
antibody bundle < $DOTFILES/antibody_plugins_arch.txt
antibody bundle < "$DOTFILES/antibody_plugins_arch.txt"
fi
# Enable zsh autocorrection
@ -73,9 +73,9 @@ aliases_file=$DOTFILES/aliases.sh # Aliases definitions
colors_file=$DOTFILES/colors.sh # Colors definitions
# Source extras
if [ -f $functions_file ]; then source $functions_file; else echo "[brethil-dotfiles] Couldn't load functions: $functions_file"; fi
if [ -f $aliases_file ]; then source $aliases_file; else echo "[brethil-dotfiles] Couldn't load aliases: $aliases_file"; fi
if [ -f $colors_file ]; then source $colors_file; else echo "[brethil-dotfiles] Couldn't load colors: $colors_file";fi
if [ -f "$functions_file" ]; then source "$functions_file"; else echo "[brethil-dotfiles] Couldn't load functions: $functions_file"; fi
if [ -f "$aliases_file" ]; then source "$aliases_file"; else echo "[brethil-dotfiles] Couldn't load aliases: $aliases_file"; fi
if [ -f "$colors_file" ]; then source "$colors_file"; else echo "[brethil-dotfiles] Couldn't load colors: $colors_file";fi
### SETUP PATHS ####
export PATH=$PATH:$HOME/bin

View File

@ -5,18 +5,6 @@
# Get the location for the dotfiles
DOTFILES=$PWD
# Install packages
# vim, zsh
# antibody: zsh plugin manager
# grc: generic colourizer, colors output of any command
# ccze: similar to the above
# byobu: configuration/wrapper for tmux
# bmon: bandwidth monitor, monitors bandwith usage, shows graph
# mtr: mytraceroute, traceroute tool
# pv: pipe view, monitor the progress of data through a pipe
# byobu: tmux wrapper
# htop: like top, but bettah
# bat: a cat clone on wings
PACKAGES="vim zsh antibody git grc ccze bmon mtr tmux byobu htop"
function setup_git {
@ -150,15 +138,16 @@ function brethil_dotfiles_setup {
mkdir -p "$bin" "$projects" "$git" && echo "Created dirs $bin, $projects, $git"
# prepare .zshrc
cp "$HOME/.zshrc"{,.pre-brethil-dotfiles}
exec 3>&1 # save stdout
exec 1>"$HOME/.zshrc"
exec 1>>"$HOME/.zshrc"
echo -e "\n\n# brethil's dotfiles:"
echo "DOTFILES=$DOTFILES"
echo "source \$DOTFILES/brethil_dotfile.sh"
echo -e "# End of brethil's dotfiles\n\n"
exec 1>&3 # restore stdout
antibody bundle $DOTFILES/antibody_plugins.txt
antibody bundle "$DOTFILES/antibody_plugins.txt"
antibody update
fix_annoyances
@ -179,19 +168,26 @@ function brethil_dotfiles_setup {
ln -s $DOTFILES/brethil.zsh-theme ${oh_my_zsh_path}/themes/ # TODO: improve this
# Symlink brethil-minimal.zsh-theme
ln -s $DOTFILES/brethil-minimal.zsh-theme ${oh_my_zsh_path}/themes/
# TODO: powerline?
}
function main(){
set -e
set -o pipefail
# Setup
brethil_dotfiles_setup
# brethil_dotfiles_setup
source "$DOTFILES/colors.sh"
echo "Functions definitions in $DOTFILES/functions.sh (you can add your own functions in ~/.dotfiles_functions)"
echo "Aliases definitions in $DOTFILES/aliases.sh (you can add your own aliases in ~/.dotfiles_aliases)"
echo "Colors are defined in $DOTFILES/colors.sh"
echo -e "$BOLD$GREEN Install complete!"
echo ""
echo "$WHITE Set \$DOTFILES to $DOTFILES"
echo -e "$RED Functions definitions:$WHITE \$DOTFILES/functions.sh\n\tyou can add your own functions in ~/.dotfiles_functions"
echo -e "$RED Aliases definitions:$WHITE \$DOTFILES/aliases.sh\n\tyou can add your own aliases in ~/.dotfiles_aliases)"
echo -e "$RED Colors definitions:$WHITE \$DOTFILES/colors.sh"
echo -e "$CLEAR"
echo "More zsh plugins can be added using antibody, adding them at \$DOTFILES/antibody_plugins.txt"
echo "Type . ~/.zshrc to source the new dotfiles, or simply launch another shell. )"
echo "Type '. ~/.zshrc' or 'exec zsh -l' to source the new configuration."
}
main