mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-10 13:51:40 +00:00
Moved exports to config/exports, fixed codestyles
This commit is contained in:
@@ -1,7 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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-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-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
|
|
||||||
|
|||||||
94
base/bashrc
94
base/bashrc
@@ -1,76 +1,9 @@
|
|||||||
|
# this is my bashrc config. there are many like it, but this one is mine.
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
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.
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
function x-load-configs()
|
function x-load-configs()
|
||||||
{
|
{
|
||||||
@@ -86,28 +19,3 @@ x-load-configs
|
|||||||
|
|
||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain
|
||||||
ssh-add -A 2>/dev/null;
|
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"
|
|
||||||
|
|||||||
@@ -5,4 +5,3 @@ email = ismo.vuorinen@vincit.fi
|
|||||||
[home]
|
[home]
|
||||||
name = Ismo Vuorinen
|
name = Ismo Vuorinen
|
||||||
email = ismo@vuorinen.net
|
email = ismo@vuorinen.net
|
||||||
|
|
||||||
|
|||||||
113
base/zshrc
113
base/zshrc
@@ -7,87 +7,6 @@ colors
|
|||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
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.
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
function x-load-configs()
|
function x-load-configs()
|
||||||
{
|
{
|
||||||
@@ -104,12 +23,6 @@ x-load-configs
|
|||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain
|
||||||
ssh-add -A 2>/dev/null;
|
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
|
# Try to load antigen, if present
|
||||||
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
|
[[ -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
|
antigen apply
|
||||||
fi
|
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)"
|
eval "$(starship init zsh)"
|
||||||
|
|
||||||
|
|||||||
11
config/alias
11
config/alias
@@ -26,14 +26,14 @@ function x-set-php-aliases
|
|||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139
|
||||||
alias "${php_alias}"r="$php_exec"
|
alias "${php_alias}"r="$php_exec"
|
||||||
# PHP with error_reporting flag.
|
# PHP with error_reporting flag.
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139,SC2140
|
||||||
alias "$php_alias"="$php_exec $php_error_reporting"
|
alias "$php_alias"="$php_exec $php_error_reporting"
|
||||||
# Local PHP Server.
|
# Local PHP Server.
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139,SC2140
|
||||||
alias "${php_alias}"s="$php_exec -S localhost:9000"
|
alias "${php_alias}s"="$php_exec -S localhost:9000"
|
||||||
# Use composer with specific PHP and error_reporting flag on.
|
# Use composer with specific PHP and error_reporting flag on.
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139,SC2140
|
||||||
alias "${php_alias}"c="$php_exec $php_error_reporting $(which composer)"
|
alias "${php_alias}c"="$php_exec $php_error_reporting $(which composer)"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -76,4 +76,3 @@ if [[ -f "$HOME/.aliases.local" ]]; then
|
|||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source "$HOME/.aliases.local"
|
source "$HOME/.aliases.local"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
113
config/exports
Normal file → Executable file
113
config/exports
Normal file → Executable file
@@ -26,5 +26,116 @@ export GREP_OPTIONS="--color=auto"
|
|||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
# check the window size after each command and, if necessary,
|
||||||
# update the values of LINES and COLUMNS.
|
# 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"
|
||||||
|
|||||||
1
config/functions
Normal file → Executable file
1
config/functions
Normal file → Executable file
@@ -65,4 +65,3 @@ function silent
|
|||||||
{
|
{
|
||||||
"$@" >&/dev/null
|
"$@" >&/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
add_newline = true
|
add_newline = true
|
||||||
|
|
||||||
# Timeout for commands executed by starship (in milliseconds).
|
# Timeout for commands executed by starship (in milliseconds).
|
||||||
command_timeout = 750
|
command_timeout = 1000
|
||||||
|
|
||||||
# Replace the '❯' symbol in the prompt with '➜'
|
# Replace the '❯' symbol in the prompt with '➜'
|
||||||
[character] # The name of the module we are configuring is 'character'
|
[character] # The name of the module we are configuring is 'character'
|
||||||
@@ -35,4 +35,3 @@ version_format = '${major}.${minor}'
|
|||||||
[nodejs]
|
[nodejs]
|
||||||
format = '[$symbol($version )]($style)'
|
format = '[$symbol($version )]($style)'
|
||||||
version_format = '${major}.${minor}'
|
version_format = '${major}.${minor}'
|
||||||
|
|
||||||
|
|||||||
@@ -6,38 +6,22 @@ export PATH="/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
|
|||||||
# Defaults
|
# Defaults
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
# Explicitly set XDG folders
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
function x-load-configs()
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
{
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
# Load the shell dotfiles, and then some:
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
||||||
|
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
||||||
# z, https://github.com/rupa/z
|
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||||
|
done
|
||||||
# composer, https://getcomposer.org/
|
}
|
||||||
if command -v composer &> /dev/null; then
|
x-load-configs
|
||||||
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
|
|
||||||
|
|
||||||
export PATH="$XDG_BIN_HOME:$HOME/bin:$HOME/.rvm/bin:$PATH"
|
export PATH="$XDG_BIN_HOME:$HOME/bin:$HOME/.rvm/bin:$PATH"
|
||||||
export LC_ALL=fi_FI.utf8
|
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
|
# Try to load antigen, if present
|
||||||
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
|
[[ -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
|
if command -v antigen &> /dev/null; then
|
||||||
antigen use oh-my-zsh
|
antigen use oh-my-zsh
|
||||||
|
|
||||||
hash git 2>/dev/null && antigen bundle git
|
antigen bundle ssh-agent
|
||||||
hash php 2>/dev/null && antigen bundle php
|
antigen bundle colored-man-pages
|
||||||
|
|
||||||
antigen bundle autojump
|
|
||||||
antigen bundle command-not-found
|
|
||||||
antigen bundle jreese/zsh-titles
|
antigen bundle jreese/zsh-titles
|
||||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||||
antigen bundle zsh-users/zsh-completions
|
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 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 theme oskarkrawczyk/honukai-iterm-zsh honukai
|
||||||
|
|
||||||
antigen apply
|
antigen apply
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias t='tail -f'
|
|
||||||
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
||||||
alias dn='du -chd1'
|
|
||||||
alias nano='nano -wS -$'
|
alias nano='nano -wS -$'
|
||||||
alias gpg=gpg2
|
alias gpg=gpg2
|
||||||
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
5
install
5
install
@@ -7,15 +7,16 @@ DOTBOT_DIR="dotbot"
|
|||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
DOTBOT_BIN="bin/dotbot"
|
||||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||||
|
|
||||||
cd "$BASEDIR"
|
cd "$BASEDIR"
|
||||||
git submodule sync --quiet --recursive
|
git submodule sync --quiet --recursive
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
|
"${DOTBOT_BIN_PATH}" \
|
||||||
-d "${BASEDIR}" \
|
-d "${BASEDIR}" \
|
||||||
--plugin-dir=dotbot-brew \
|
--plugin-dir=dotbot-brew \
|
||||||
--plugin-dir=dotbot-if \
|
|
||||||
--plugin-dir=dotbot-gh-extension \
|
--plugin-dir=dotbot-gh-extension \
|
||||||
|
--plugin-dir=dotbot-if \
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|||||||
@@ -7,19 +7,14 @@ DOTBOT_DIR="dotbot"
|
|||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
DOTBOT_BIN="bin/dotbot"
|
||||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||||
|
|
||||||
cd "$BASEDIR"
|
cd "$BASEDIR"
|
||||||
git submodule sync --quiet --recursive
|
git submodule sync --quiet --recursive
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
|
"${DOTBOT_BIN_PATH}" \
|
||||||
-d "${BASEDIR}" \
|
-d "${BASEDIR}" \
|
||||||
-c "${CONFIG}" \
|
-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 \
|
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
- defaults:
|
- defaults:
|
||||||
brewfile:
|
|
||||||
stderr: true
|
|
||||||
stdout: true
|
|
||||||
create:
|
create:
|
||||||
mode: 0755
|
mode: 0755
|
||||||
link:
|
link:
|
||||||
create: true
|
create: true
|
||||||
relink: true
|
|
||||||
exclude: ["*.md", "*renovate*"]
|
exclude: ["*.md", "*renovate*"]
|
||||||
- clean:
|
- clean:
|
||||||
~/:
|
~/:
|
||||||
|
|||||||
@@ -24,26 +24,33 @@ function section_install
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
all)
|
all)
|
||||||
|
$0 install macos
|
||||||
$0 install antigen
|
$0 install antigen
|
||||||
$0 install starship
|
$0 install starship
|
||||||
$0 install nvm
|
$0 install nvm
|
||||||
$0 install macos
|
|
||||||
$0 install npm
|
$0 install npm
|
||||||
;;
|
;;
|
||||||
antigen)
|
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)
|
starship)
|
||||||
curl -sS https://starship.rs/install.sh | sh -s -- --bin-dir ~/.local/bin && msg_done "🎉 starship installed!"
|
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!"
|
|
||||||
;;
|
;;
|
||||||
macos)
|
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)
|
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)
|
settler)
|
||||||
bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Settler has been run!"
|
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 "all" "Installs antigen, macos, brew and ext_gh"
|
||||||
menu_item "antigen" "Updates the antigen.zsh file"
|
menu_item "antigen" "Updates the antigen.zsh file"
|
||||||
menu_item "starship" "Install starship.rs"
|
menu_item "starship" "Install starship.rs"
|
||||||
|
menu_item "macos" "Setup nice macOS defaults"
|
||||||
menu_item "nvm" "Install Node Version Manager (nvm)"
|
menu_item "nvm" "Install Node Version Manager (nvm)"
|
||||||
menu_item "npm" "Install NPM Packages"
|
menu_item "npm" "Install NPM Packages"
|
||||||
menu_item "macos" "Setup nice macOS defaults"
|
|
||||||
menu_item "settler" "Runs the WIP settler.sh"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -134,12 +140,14 @@ function section_dotfiles
|
|||||||
-not -path '*dotbot*' \
|
-not -path '*dotbot*' \
|
||||||
-not -name '*.pl' \
|
-not -name '*.pl' \
|
||||||
-not -name '*.py' \
|
-not -name '*.py' \
|
||||||
|
-not -name '*.php' \
|
||||||
|
-not -name '*.zsh' \
|
||||||
-exec shfmt \
|
-exec shfmt \
|
||||||
--language-dialect bash \
|
--language-dialect bash \
|
||||||
--func-next-line --list --write \
|
--func-next-line --list --write \
|
||||||
--indent 2 --case-indent --space-redirects \
|
--indent 2 --case-indent --space-redirects \
|
||||||
--binary-next-line {} \;
|
--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"
|
menu_section "$USAGE_PREFIX" "reset_all | reset_nvim | yamlfmt | shfmt"
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
if command -v php &> /dev/null; then
|
||||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
|
||||||
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
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" ]
|
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
|
||||||
then
|
echo >&2 'ERROR: Invalid installer checksum'
|
||||||
>&2 echo 'ERROR: Invalid installer checksum'
|
|
||||||
rm composer-setup.php
|
rm composer-setup.php
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
php composer-setup.php --quiet
|
||||||
|
RESULT=$?
|
||||||
|
rm composer-setup.php
|
||||||
|
mv composer.phar ~/.local/bin/composer
|
||||||
|
exit $RESULT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
php composer-setup.php --quiet
|
|
||||||
RESULT=$?
|
|
||||||
rm composer-setup.php
|
|
||||||
mv composer.phar ~/.local/bin/composer
|
|
||||||
exit $RESULT
|
|
||||||
|
|
||||||
|
|||||||
@@ -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"
|
|
||||||
13
scripts/install-ntfy.sh
Executable file
13
scripts/install-ntfy.sh
Executable file
@@ -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"
|
||||||
Reference in New Issue
Block a user