diff --git a/add-submodules.sh b/add-submodules.sh index 74b1ed4..570970c 100644 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -1,7 +1,4 @@ #!/usr/bin/env bash -git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git dotbot-brew git submodule add --name dotbot-gh-extension -f https://github.com/fundor333/dotbot-gh-extension.git dotbot-gh-extension -git submodule add --name dotbot-golang -f https://github.com/delicb/dotbot-golang.git dotbot-golang git submodule add --name dotbot-if -f https://github.com/wonderbeyond/dotbot-if.git dotbot-if -git submodule add --name dotbot-ifplatform -f https://github.com/ssbanerje/dotbot-ifplatform.git dotbot-ifplatform diff --git a/base/bashrc b/base/bashrc index 742fe8a..5be2806 100644 --- a/base/bashrc +++ b/base/bashrc @@ -1,76 +1,9 @@ +# this is my bashrc config. there are many like it, but this one is mine. # shellcheck shell=bash # Defaults export DOTFILES="$HOME/.dotfiles" -# Explicitly set XDG folders -# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_STATE_HOME="$HOME/.local/state" -export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom - -# Homebrew configuration -export HOMEBREW="/opt/homebrew" -export HOMEBREW_BIN="$HOMEBREW/bin" -export HOMEBREW_SBIN="$HOMEBREW/sbin" -export HOMEBREW_PKG="$HOMEBREW/opt" -export HOMEBREW_NO_ENV_HINTS=1 - -export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH" - -# brew, https://brew.sh -if command -v brew &> /dev/null; then - BREW_BIN=$(brew --prefix)/bin - BREW_SBIN=$(brew --prefix)/sbin - - BREW_PYTHON=$(brew --prefix python@3.8)/bin - GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin - BREW_RUBY=$(brew --prefix ruby)/bin - BREW_GEMS=$(gem environment gemdir)/bin - - export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$BREW_BIN:$BREW_SBIN:$PATH" -fi - -# nvm, the node version manager -export NVM_LAZY_LOAD=true -export NVM_COMPLETION=true -export NVM_AUTO_USE=true -export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm - -# If we have go packages, include them to the PATH -if command -v go &> /dev/null; then - export GOPATH=$(go env GOPATH); - if [ -d "$GOPATH/bin" ]; then - export PATH="$GOPATH/bin:$PATH" - fi -fi - -if command -v nvim &> /dev/null; then - export EDITOR="nvim" -fi - -# z, https://github.com/rupa/z -export _Z_DATA="$XDG_STATE_HOME/z" - -# composer, https://getcomposer.org/ -if command -v composer &> /dev/null; then - export COMPOSER_HOME="$XDG_STATE_HOME/composer" - export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin" - export PATH="$COMPOSER_BIN:$PATH" -fi - -# gem, rubygems -if command -v gem &>/dev/null; then - export GEM_HOME="$XDG_STATE_HOME/gem" - export GEM_PATH="$XDG_STATE_HOME/gem" -fi - - -# wakatime, https://github.com/wakatime/wakatime-cli -export WAKATIME_HOME="$XDG_STATE_HOME/wakatime" - # Run x-load-configs in your terminal to reload the files. function x-load-configs() { @@ -86,28 +19,3 @@ x-load-configs # Import ssh keys in keychain ssh-add -A 2>/dev/null; - -# op (1Password cli) is present -if hash op 2>/dev/null; then - export OP_CACHE="$XDG_STATE_HOME/1password" - mkdir -p "$OP_CACHE"; - eval "$(op completion zsh)"; compdef _op op -fi - -# Ansible configuration -# https://docs.ansible.com/ansible/latest/reference_appendices/config.html -if hash ansible 2>/dev/null; then - export ANSIBLE_HOME="$XDG_STATE_HOME/ansible" - mkdir -p "$ANSIBLE_HOME" -fi - -# gcloud is present -#if hash gcloud 2>/dev/null; then -# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet) -# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc" -# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc" -#fi - -# Load iterm2 shell integration -# https://iterm2.com/documentation-shell-integration.html -[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh" diff --git a/base/ecrc b/base/ecrc index 9ad087d..58b3718 100644 --- a/base/ecrc +++ b/base/ecrc @@ -17,4 +17,3 @@ "MaxLineLength": false } } - diff --git a/base/git_profiles b/base/git_profiles index 8b658fb..5fd7d65 100644 --- a/base/git_profiles +++ b/base/git_profiles @@ -5,4 +5,3 @@ email = ismo.vuorinen@vincit.fi [home] name = Ismo Vuorinen email = ismo@vuorinen.net - diff --git a/base/zshrc b/base/zshrc index e41e36c..28afee9 100644 --- a/base/zshrc +++ b/base/zshrc @@ -7,87 +7,6 @@ colors # Defaults export DOTFILES="$HOME/.dotfiles" -# Explicitly set XDG folders -# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_STATE_HOME="$HOME/.local/state" -export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom - -# Homebrew configuration -export HOMEBREW="/opt/homebrew" -export HOMEBREW_BIN="$HOMEBREW/bin" -export HOMEBREW_SBIN="$HOMEBREW/sbin" -export HOMEBREW_PKG="$HOMEBREW/opt" -export HOMEBREW_NO_ENV_HINTS=1 - -export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH" - -# brew, https://brew.sh -if [ command -v brew &> /dev/null ]; then - BREW_PYTHON=$(brew --prefix python)/bin - GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin - BREW_RUBY=$(brew --prefix ruby)/bin - BREW_GEMS=$(gem environment gemdir)/bin - - export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$PATH" -fi - -# nvm, the node version manager -export NVM_LAZY_LOAD=true -export NVM_COMPLETION=true -export NVM_AUTO_USE=true -export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -# If we have go packages, include them to the PATH -if command -v go &> /dev/null; then - export GOPATH="$XDG_DATA_HOME/go"; - export GOBIN="$XDG_BIN_HOME" - mkdir -p "$GOPATH" -fi - -if command -v nvim &> /dev/null; then - export EDITOR="nvim" -fi - -# docker, https://docs.docker.com/engine/reference/commandline/cli/ -if command -v docker &> /dev/null; then - export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" - mkdir -p "$DOCKER_CONFIG" -fi - -# z, https://github.com/rupa/z -export _Z_DATA="$XDG_STATE_HOME/z" - -# composer, https://getcomposer.org/ -if command -v composer &> /dev/null; then - export COMPOSER_HOME="$XDG_STATE_HOME/composer" - export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin" - export PATH="$COMPOSER_BIN:$PATH" -fi - -# gem, rubygems -if command -v gem &>/dev/null; then - export GEM_HOME="$XDG_STATE_HOME/gem" - export GEM_PATH="$XDG_STATE_HOME/gem" - export PATH="$GEM_HOME/bin:$PATH" -fi - - -# pyenv, python environments -export PYENV_ROOT="$XDG_STATE_HOME/pyenv" -mkdir -p "$PYENV_ROOT" -export PATH="$PYENV_ROOT/bin:$PATH" - -if command -v pyenv &>/dev/null; then - eval "$(pyenv init -)" -fi - -# wakatime, https://github.com/wakatime/wakatime-cli -export WAKATIME_HOME="$XDG_STATE_HOME/wakatime" - # Run x-load-configs in your terminal to reload the files. function x-load-configs() { @@ -104,12 +23,6 @@ x-load-configs # Import ssh keys in keychain ssh-add -A 2>/dev/null; -# Antigen configuration -# https://github.com/zsh-users/antigen/wiki/Configuration -export ADOTDIR="$XDG_DATA_HOME/antigen" -export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate" -export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate" - # Try to load antigen, if present [[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh" @@ -149,30 +62,4 @@ if command -v antigen &> /dev/null; then antigen apply fi -# op (1Password cli) is present -if hash op 2>/dev/null; then - export OP_CACHE="$XDG_STATE_HOME/1password" - mkdir -p $OP_CACHE; - eval "$(op completion zsh)"; compdef _op op -fi - -# Ansible configuration -# https://docs.ansible.com/ansible/latest/reference_appendices/config.html -if hash ansible 2>/dev/null; then - export ANSIBLE_HOME="$XDG_STATE_HOME/ansible" - mkdir -p "$ANSIBLE_HOME" -fi - -# gcloud is present -#if hash gcloud 2>/dev/null; then -# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet) -# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc" -# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc" -#fi - -# Load iterm2 shell integration -# https://iterm2.com/documentation-shell-integration.html -[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh" - eval "$(starship init zsh)" - diff --git a/config/alias b/config/alias index 29fb8d1..28f2dde 100644 --- a/config/alias +++ b/config/alias @@ -26,14 +26,14 @@ function x-set-php-aliases # shellcheck disable=SC2139 alias "${php_alias}"r="$php_exec" # PHP with error_reporting flag. - # shellcheck disable=SC2139 + # shellcheck disable=SC2139,SC2140 alias "$php_alias"="$php_exec $php_error_reporting" # Local PHP Server. - # shellcheck disable=SC2139 - alias "${php_alias}"s="$php_exec -S localhost:9000" + # shellcheck disable=SC2139,SC2140 + alias "${php_alias}s"="$php_exec -S localhost:9000" # Use composer with specific PHP and error_reporting flag on. - # shellcheck disable=SC2139 - alias "${php_alias}"c="$php_exec $php_error_reporting $(which composer)" + # shellcheck disable=SC2139,SC2140 + alias "${php_alias}c"="$php_exec $php_error_reporting $(which composer)" done fi } @@ -76,4 +76,3 @@ if [[ -f "$HOME/.aliases.local" ]]; then # shellcheck disable=SC1091 source "$HOME/.aliases.local" fi - diff --git a/config/exports b/config/exports old mode 100644 new mode 100755 index 81d295b..eda5395 --- a/config/exports +++ b/config/exports @@ -26,5 +26,116 @@ export GREP_OPTIONS="--color=auto" # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. -hash shopt 2>/dev/null && shopt -s checkwinsize +hash shopt 2> /dev/null && shopt -s checkwinsize +# Explicitly set XDG folders +# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_STATE_HOME="$HOME/.local/state" +export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom + +# Antigen configuration +# https://github.com/zsh-users/antigen/wiki/Configuration +export ADOTDIR="$XDG_DATA_HOME/antigen" +export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate" +export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate" + +# Homebrew configuration +export HOMEBREW="/opt/homebrew" +export HOMEBREW_BIN="$HOMEBREW/bin" +export HOMEBREW_SBIN="$HOMEBREW/sbin" +export HOMEBREW_PKG="$HOMEBREW/opt" +export HOMEBREW_NO_ENV_HINTS=1 + +export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH" + +# brew, https://brew.sh +if command -v brew &> /dev/null; then + BREW_PYTHON=$(brew --prefix python)/bin + GNUBIN_DIR=$(brew --prefix coreutils)/libexec/gnubin + BREW_RUBY=$(brew --prefix ruby)/bin + BREW_GEMS=$(gem environment gemdir)/bin + + export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$PATH" +fi + +# nvm, the node version manager +export NVM_LAZY_LOAD=true +export NVM_COMPLETION=true +export NVM_AUTO_USE=true +export NVM_DIR="${XDG_CONFIG_HOME}/nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# If we have go packages, include them to the PATH +if command -v go &> /dev/null; then + export GOPATH="$XDG_DATA_HOME/go" + export GOBIN="$XDG_BIN_HOME" + mkdir -p "$GOPATH" +fi + +if command -v nvim &> /dev/null; then + export EDITOR="nvim" +fi + +# docker, https://docs.docker.com/engine/reference/commandline/cli/ +if command -v docker &> /dev/null; then + export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" + mkdir -p "$DOCKER_CONFIG" +fi + +# z, https://github.com/rupa/z +export _Z_DATA="$XDG_STATE_HOME/z" + +# composer, https://getcomposer.org/ +if command -v composer &> /dev/null; then + export COMPOSER_HOME="$XDG_STATE_HOME/composer" + export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin" + export PATH="$COMPOSER_BIN:$PATH" +fi + +# gem, rubygems +if command -v gem &> /dev/null; then + export GEM_HOME="$XDG_STATE_HOME/gem" + export GEM_PATH="$XDG_STATE_HOME/gem" + export PATH="$GEM_HOME/bin:$PATH" +fi + +# pyenv, python environments +export PYENV_ROOT="$XDG_STATE_HOME/pyenv" +mkdir -p "$PYENV_ROOT" +export PATH="$PYENV_ROOT/bin:$PATH" + +if command -v pyenv &> /dev/null; then + eval "$(pyenv init -)" +fi + +# wakatime, https://github.com/wakatime/wakatime-cli +export WAKATIME_HOME="$XDG_STATE_HOME/wakatime" + +# op (1Password cli) is present +if hash op 2> /dev/null; then + export OP_CACHE="$XDG_STATE_HOME/1password" + mkdir -p "$OP_CACHE" + eval "$(op completion zsh)" + compdef _op op +fi + +# Ansible configuration +# https://docs.ansible.com/ansible/latest/reference_appendices/config.html +if hash ansible 2> /dev/null; then + export ANSIBLE_HOME="$XDG_STATE_HOME/ansible" + mkdir -p "$ANSIBLE_HOME" +fi + +# gcloud is present +#if hash gcloud 2>/dev/null; then +# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet) +# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc" +# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc" +#fi + +# Load iterm2 shell integration +# https://iterm2.com/documentation-shell-integration.html +[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh" diff --git a/config/functions b/config/functions old mode 100644 new mode 100755 index 8563109..327940c --- a/config/functions +++ b/config/functions @@ -65,4 +65,3 @@ function silent { "$@" >&/dev/null } - diff --git a/config/starship.toml b/config/starship.toml index a6727a5..79d338b 100644 --- a/config/starship.toml +++ b/config/starship.toml @@ -5,7 +5,7 @@ add_newline = true # Timeout for commands executed by starship (in milliseconds). -command_timeout = 750 +command_timeout = 1000 # Replace the '❯' symbol in the prompt with '➜' [character] # The name of the module we are configuring is 'character' @@ -35,4 +35,3 @@ version_format = '${major}.${minor}' [nodejs] format = '[$symbol($version )]($style)' version_format = '${major}.${minor}' - diff --git a/hosts/lakka/zshrc b/hosts/lakka/base/zshrc similarity index 53% rename from hosts/lakka/zshrc rename to hosts/lakka/base/zshrc index b331719..8e49fc6 100644 --- a/hosts/lakka/zshrc +++ b/hosts/lakka/base/zshrc @@ -6,38 +6,22 @@ export PATH="/usr/local/bin:/usr/bin:/usr/sbin:$PATH" # Defaults export DOTFILES="$HOME/.dotfiles" -# Explicitly set XDG folders -# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_STATE_HOME="$HOME/.local/state" -export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom - -# z, https://github.com/rupa/z -export _Z_DATA="$XDG_STATE_HOME/z" - -# composer, https://getcomposer.org/ -if command -v composer &> /dev/null; then - export COMPOSER_HOME="$XDG_STATE_HOME/composer" - export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin" - export PATH="$COMPOSER_BIN:$PATH" -fi - -# gem, rubygems -if command -v gem &>/dev/null; then - export GEM_HOME="$XDG_STATE_HOME/gem" - export PATH="$GEM_HOME/bin:$PATH" -fi +# Run x-load-configs in your terminal to reload the files. +function x-load-configs() +{ + # Load the shell dotfiles, and then some: + for file in $DOTFILES/config/{exports,alias,functions}; do + [ -r "$file" ] && [ -f "$file" ] && source "$file" + [ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret" + [ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME" + [ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret" + done +} +x-load-configs export PATH="$XDG_BIN_HOME:$HOME/bin:$HOME/.rvm/bin:$PATH" export LC_ALL=fi_FI.utf8 -# Antigen configuration -# https://github.com/zsh-users/antigen/wiki/Configuration -export ADOTDIR="$XDG_DATA_HOME/antigen" -export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate" -export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate" - # Try to load antigen, if present [[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh" @@ -45,25 +29,30 @@ export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate" if command -v antigen &> /dev/null; then antigen use oh-my-zsh - hash git 2>/dev/null && antigen bundle git - hash php 2>/dev/null && antigen bundle php - - antigen bundle autojump - antigen bundle command-not-found + antigen bundle ssh-agent + antigen bundle colored-man-pages antigen bundle jreese/zsh-titles antigen bundle zsh-users/zsh-syntax-highlighting antigen bundle zsh-users/zsh-completions - antigen bundle unixorn/rvm-plugin + antigen bundle MichaelAquilina/zsh-you-should-use antigen bundle unixorn/autoupdate-antigen.zshplugin + antigen bundle Sparragus/zsh-auto-nvm-use + antigen bundle autojump + antigen bundle command-not-found + antigen bundle unixorn/rvm-plugin + + hash git 2>/dev/null && antigen bundle git + hash php 2>/dev/null && antigen bundle php + hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv + hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin + hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin antigen theme oskarkrawczyk/honukai-iterm-zsh honukai antigen apply fi -alias t='tail -f' alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state' -alias dn='du -chd1' alias nano='nano -wS -$' alias gpg=gpg2 diff --git a/hosts/tunkki/bashrc b/hosts/tunkki/bashrc deleted file mode 100644 index a81d389..0000000 --- a/hosts/tunkki/bashrc +++ /dev/null @@ -1,118 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -#force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# colored GCC warnings and errors -#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi - diff --git a/install b/install index 2f39ad0..849b6ef 100755 --- a/install +++ b/install @@ -7,15 +7,16 @@ DOTBOT_DIR="dotbot" DOTBOT_BIN="bin/dotbot" BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" cd "$BASEDIR" git submodule sync --quiet --recursive git submodule update --init --recursive -"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \ +"${DOTBOT_BIN_PATH}" \ -d "${BASEDIR}" \ --plugin-dir=dotbot-brew \ - --plugin-dir=dotbot-if \ --plugin-dir=dotbot-gh-extension \ + --plugin-dir=dotbot-if \ -c "${CONFIG}" \ "${@}" diff --git a/install-without-plugins b/install-without-plugins index a5441a5..3000d34 100755 --- a/install-without-plugins +++ b/install-without-plugins @@ -7,19 +7,14 @@ DOTBOT_DIR="dotbot" DOTBOT_BIN="bin/dotbot" BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" cd "$BASEDIR" git submodule sync --quiet --recursive git submodule update --init --recursive -"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \ +"${DOTBOT_BIN_PATH}" \ -d "${BASEDIR}" \ -c "${CONFIG}" \ "${@}" -# --plugin-dir=dotbot-plugins/dotbot-brew \ -# --plugin-dir=dotbot-plugins/dotbot-gh-extension \ -# --plugin-dir=dotbot-plugins/dotbot-golang \ -# --plugin-dir=dotbot-plugins/dotbot-if \ -# --plugin-dir=dotbot-plugins/dotbot-ifplatform \ -# -p dotbot-plugins/dotbot-if/if.py \ diff --git a/install.conf.yaml b/install.conf.yaml index 104719e..5dcba50 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -1,12 +1,8 @@ - defaults: - brewfile: - stderr: true - stdout: true create: mode: 0755 link: create: true - relink: true exclude: ["*.md", "*renovate*"] - clean: ~/: diff --git a/local/bin/dfm b/local/bin/dfm index 42dda5c..fee9708 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -24,26 +24,33 @@ function section_install case "$1" in all) + $0 install macos $0 install antigen $0 install starship $0 install nvm - $0 install macos $0 install npm ;; antigen) - curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" && msg_done "🎉 New antigen installed!" + curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" \ + && msg_done "🎉 New antigen installed!" + ;; ;; starship) - curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin && msg_done "🎉 starship installed!" - ;; - nvm) - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && msg_done " ^=^n^i nvm installed!" + curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin \ + && msg_done "🎉 starship installed!" ;; macos) - bash "$DOTFILES/scripts/set-macos-defaults.sh" && msg_done "🎉 Brewfile defined apps has been installed!" + bash "$DOTFILES/scripts/set-macos-defaults.sh" \ + && msg_done "🎉 Brewfile defined apps has been installed!" + ;; + nvm) + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash \ + && nvm install --lts --latest-npm --default \ + && msg_done "🎉 nvm installed!" ;; npm) - bash "$DOTFILES/scripts/install-npm-packages.sh" && msg_done "NPM Packages have been installed!" + bash "$DOTFILES/scripts/install-npm-packages.sh" \ + && msg_done "NPM Packages have been installed!" ;; settler) bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Settler has been run!" @@ -53,10 +60,9 @@ function section_install menu_item "all" "Installs antigen, macos, brew and ext_gh" menu_item "antigen" "Updates the antigen.zsh file" menu_item "starship" "Install starship.rs" + menu_item "macos" "Setup nice macOS defaults" menu_item "nvm" "Install Node Version Manager (nvm)" menu_item "npm" "Install NPM Packages" - menu_item "macos" "Setup nice macOS defaults" - menu_item "settler" "Runs the WIP settler.sh" ;; esac } @@ -134,12 +140,14 @@ function section_dotfiles -not -path '*dotbot*' \ -not -name '*.pl' \ -not -name '*.py' \ + -not -name '*.php' \ + -not -name '*.zsh' \ -exec shfmt \ --language-dialect bash \ --func-next-line --list --write \ --indent 2 --case-indent --space-redirects \ --binary-next-line {} \; - msg_done "🎉 dotfiles have been formatted!" + msg_done "🎉 dotfiles have been shfmt formatted!" ;; *) menu_section "$USAGE_PREFIX" "reset_all | reset_nvim | yamlfmt | shfmt" diff --git a/scripts/install-composer.sh b/scripts/install-composer.sh index 689babb..146a8c1 100755 --- a/scripts/install-composer.sh +++ b/scripts/install-composer.sh @@ -1,19 +1,19 @@ -#!/bin/sh +#!/bin/bash -EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" +if command -v php &> /dev/null; then + EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" + php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" + ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" -if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] -then - >&2 echo 'ERROR: Invalid installer checksum' + if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then + echo >&2 'ERROR: Invalid installer checksum' rm composer-setup.php exit 1 + fi + + php composer-setup.php --quiet + RESULT=$? + rm composer-setup.php + mv composer.phar ~/.local/bin/composer + exit $RESULT fi - -php composer-setup.php --quiet -RESULT=$? -rm composer-setup.php -mv composer.phar ~/.local/bin/composer -exit $RESULT - diff --git a/scripts/install-nfty.sh b/scripts/install-nfty.sh deleted file mode 100755 index 7f0f133..0000000 --- a/scripts/install-nfty.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -NFTY_VERSION=2.2.0 - -curl -L "https://github.com/binwiederhier/ntfy/releases/download/v${NFTY_VERSION}/ntfy_${NFTY_VERSION}_macOS_all.tar.gz" > "ntfy_${NFTY_VERSION}_macOS_all.tar.gz" -tar zxvf "ntfy_${NFTY_VERSION}_macOS_all.tar.gz" -cp -a "ntfy_${NFTY_VERSION}_macOS_all/ntfy" ~/.local/bin/ntfy -mkdir -p ~/.config/ntfy -cp "ntfy_${NFTY_VERSION}_macOS_all/client/client.yml" ~/.config/ntfy/client.yml -ntfy --help -rm -rf "ntfy_${NFTY_VERSION}_macOS_all" "ntfy_${NFTY_VERSION}_macOS_all.tar.gz" diff --git a/scripts/install-ntfy.sh b/scripts/install-ntfy.sh new file mode 100755 index 0000000..5b38e02 --- /dev/null +++ b/scripts/install-ntfy.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +NTFY_VERSION=2.2.0 +NTFY_URL="https://github.com/binwiederhier/ntfy" +NTFY_DEST="ntfy_${NTFY_VERSION}_macOS_all" + +curl -L "$NTFY_URL/releases/download/v${NTFY_VERSION}/${NTFY_DEST}.tar.gz" > "${NTFY_DEST}.tar.gz" +tar zxvf "${NTFY_DEST}.tar.gz" +cp -a "${NTFY_DEST}/ntfy" ~/.local/bin/ntfy +mkdir -p ~/.config/ntfy +cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml +ntfy --help +rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"