mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-01 20:47:42 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f5f79d270 | |||
| dcd042262f | |||
| 268fd35bdb | |||
| 38a6f6f8e4 | |||
| d504fc5f2b | |||
| 4b1feb16fc | |||
| 9331b2b643 | |||
| 5ce9906ff1 | |||
| dbadcc3b6c | |||
|
|
4f2fd3cfd6 | ||
| 9621c67866 | |||
| 5e59893281 | |||
| ea292de853 | |||
| d2cedd0fee | |||
| 995cc569e7 | |||
| cceeba3f8e | |||
| dd3640586e | |||
|
|
11969bf791 |
@@ -29,6 +29,3 @@ switch_case_indent = true # --case-indent
|
|||||||
space_redirects = false
|
space_redirects = false
|
||||||
keep_padding = false
|
keep_padding = false
|
||||||
function_next_line = true # --func-next-line
|
function_next_line = true # --func-next-line
|
||||||
|
|
||||||
[local/bin/antigen.zsh]
|
|
||||||
ignore = true
|
|
||||||
|
|||||||
21
.gitmodules
vendored
21
.gitmodules
vendored
@@ -8,24 +8,9 @@
|
|||||||
url = https://github.com/wren/dotbot-brew.git
|
url = https://github.com/wren/dotbot-brew.git
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "dotbot-if"]
|
[submodule "dotbot-include"]
|
||||||
path = dotbot-if
|
path = dotbot-include
|
||||||
url = https://github.com/wonderbeyond/dotbot-if.git
|
url = https://gitlab.com/gnfzdz/dotbot-include.git
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "dotbot-ifplatform"]
|
|
||||||
path = dotbot-ifplatform
|
|
||||||
url = https://github.com/ssbanerje/dotbot-ifplatform.git
|
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "dotbot-gh-extension"]
|
|
||||||
path = dotbot-gh-extension
|
|
||||||
url = https://github.com/fundor333/dotbot-gh-extension.git
|
|
||||||
ignore = dirty
|
|
||||||
|
|
||||||
[submodule "dotbot-golang"]
|
|
||||||
path = dotbot-golang
|
|
||||||
url = https://github.com/delicb/dotbot-golang.git
|
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "config/nvim"]
|
[submodule "config/nvim"]
|
||||||
|
|||||||
1
.yamlfmt
1
.yamlfmt
@@ -22,4 +22,3 @@ exclude:
|
|||||||
- ./dotbot-*/**
|
- ./dotbot-*/**
|
||||||
- ./config/astronvim/**
|
- ./config/astronvim/**
|
||||||
- ./config/nvim/**
|
- ./config/nvim/**
|
||||||
|
|
||||||
|
|||||||
12
Brewfile
12
Brewfile
@@ -23,6 +23,8 @@ brew "ansible"
|
|||||||
brew "ansible-lint"
|
brew "ansible-lint"
|
||||||
# Zstandard is a real-time compression algorithm
|
# Zstandard is a real-time compression algorithm
|
||||||
brew "zstd"
|
brew "zstd"
|
||||||
|
# Open Source Kubernetes Marketplace
|
||||||
|
brew "arkade"
|
||||||
# Spell checker with better logic than ispell
|
# Spell checker with better logic than ispell
|
||||||
brew "aspell"
|
brew "aspell"
|
||||||
# Automatic configure script builder
|
# Automatic configure script builder
|
||||||
@@ -31,6 +33,8 @@ brew "autoconf"
|
|||||||
brew "awscli"
|
brew "awscli"
|
||||||
# Terminal bandwidth utilization tool
|
# Terminal bandwidth utilization tool
|
||||||
brew "bandwhich"
|
brew "bandwhich"
|
||||||
|
# Clone of cat(1) with syntax highlighting and Git integration
|
||||||
|
brew "bat"
|
||||||
# Yet another cross-platform graphical process/system monitor
|
# Yet another cross-platform graphical process/system monitor
|
||||||
brew "bottom"
|
brew "bottom"
|
||||||
# Switch Apache / Valet / CLI configs between PHP versions
|
# Switch Apache / Valet / CLI configs between PHP versions
|
||||||
@@ -99,6 +103,8 @@ brew "netpbm"
|
|||||||
brew "icu4c"
|
brew "icu4c"
|
||||||
# OpenType text shaping engine
|
# OpenType text shaping engine
|
||||||
brew "harfbuzz"
|
brew "harfbuzz"
|
||||||
|
# Framework for layout and rendering of i18n text
|
||||||
|
brew "pango"
|
||||||
# Library to render SVG files using Cairo
|
# Library to render SVG files using Cairo
|
||||||
brew "librsvg"
|
brew "librsvg"
|
||||||
# Graph visualization software from AT&T and Bell Labs
|
# Graph visualization software from AT&T and Bell Labs
|
||||||
@@ -193,6 +199,8 @@ brew "tldr"
|
|||||||
brew "tmux"
|
brew "tmux"
|
||||||
# Display directories as trees (with optional color/HTML output)
|
# Display directories as trees (with optional color/HTML output)
|
||||||
brew "tree"
|
brew "tree"
|
||||||
|
# Vulnerability scanner for container images, file systems, and Git repos
|
||||||
|
brew "trivy"
|
||||||
# Modern watch command
|
# Modern watch command
|
||||||
brew "viddy"
|
brew "viddy"
|
||||||
# Tool for creating isolated virtual python environments
|
# Tool for creating isolated virtual python environments
|
||||||
@@ -207,8 +215,6 @@ brew "wget"
|
|||||||
brew "wtfutil"
|
brew "wtfutil"
|
||||||
# JavaScript package manager
|
# JavaScript package manager
|
||||||
brew "yarn"
|
brew "yarn"
|
||||||
# Tracks most-used directories to make cd smarter
|
|
||||||
brew "z"
|
|
||||||
# A vulnerability scanner for container images and filesystems
|
# A vulnerability scanner for container images and filesystems
|
||||||
brew "anchore/grype/grype"
|
brew "anchore/grype/grype"
|
||||||
# High-performance load testing tool, written in Golang.
|
# High-performance load testing tool, written in Golang.
|
||||||
@@ -267,6 +273,8 @@ cask "insomnia"
|
|||||||
cask "jetbrains-toolbox"
|
cask "jetbrains-toolbox"
|
||||||
# Kubernetes IDE
|
# Kubernetes IDE
|
||||||
cask "lens"
|
cask "lens"
|
||||||
|
# Neovim Client
|
||||||
|
cask "neovide"
|
||||||
# Reverse proxy, secure introspectable tunnels to localhost
|
# Reverse proxy, secure introspectable tunnels to localhost
|
||||||
cask "ngrok"
|
cask "ngrok"
|
||||||
# Collaboration platform for API development
|
# Collaboration platform for API development
|
||||||
|
|||||||
@@ -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-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-include -f https://gitlab.com/gnfzdz/dotbot-include.git dotbot-include
|
||||||
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
|
|
||||||
|
|||||||
6
base/angular-config.json
Normal file
6
base/angular-config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"cli": {
|
||||||
|
"analytics": false
|
||||||
|
}
|
||||||
|
}
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
159
base/zshrc
159
base/zshrc
@@ -7,168 +7,35 @@ 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_BIN=$(brew --prefix)/bin
|
|
||||||
BREW_SBIN=$(brew --prefix)/sbin
|
|
||||||
|
|
||||||
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:$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
|
|
||||||
[ -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
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
# 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()
|
||||||
{
|
{
|
||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
[ -f "$file" ] && source "$file"
|
||||||
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
[ -f "$file-secret" ] && source "$file-secret"
|
||||||
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
[ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||||
[ -r "$file-$HOSTNAME-secret" ] && [ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
[ -f "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
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"
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||||
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||||
|
|
||||||
# antigen is present
|
# antigen is present
|
||||||
if command -v antigen &> /dev/null; then
|
if command -v antigen &> /dev/null; then
|
||||||
antigen use oh-my-zsh
|
antigen use oh-my-zsh
|
||||||
|
|
||||||
antigen bundle ssh-agent
|
# config/functions
|
||||||
antigen bundle colored-man-pages
|
x-default-antigen-bundles
|
||||||
antigen bundle jreese/zsh-titles
|
|
||||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
|
||||||
antigen bundle zsh-users/zsh-completions
|
|
||||||
antigen bundle MichaelAquilina/zsh-you-should-use
|
|
||||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
|
||||||
antigen bundle Sparragus/zsh-auto-nvm-use
|
|
||||||
|
|
||||||
hash php 2>/dev/null && antigen bundle php
|
antigen apply
|
||||||
hash nvm 2>/dev/null && antigen bundle nvm
|
|
||||||
hash docker 2>/dev/null && antigen bundle docker
|
|
||||||
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
|
|
||||||
|
|
||||||
# Platform dependant bundles
|
|
||||||
if [[ $(uname) == 'Linux' ]]; then
|
|
||||||
antigen bundle command-not-found
|
|
||||||
elif [[ $(uname) == 'Darwin' ]]; then
|
|
||||||
# If we have brew installed
|
|
||||||
if command -v brew &> /dev/null; then
|
|
||||||
# Only enable brew plugin if brew exists
|
|
||||||
antigen bundle brew
|
|
||||||
# load Z
|
|
||||||
[[ -f "$(brew --prefix z)/etc/profile.d/z.sh" ]] && source "$(brew --prefix z)/etc/profile.d/z.sh"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
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)"
|
||||||
|
|
||||||
|
|||||||
50
config/alias
Normal file → Executable file
50
config/alias
Normal file → Executable file
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# macOS specific
|
|
||||||
|
|
||||||
# Get installed php versions from brew and setup aliases
|
# Get installed php versions from brew and setup aliases
|
||||||
function x-set-php-aliases
|
function x-set-php-aliases
|
||||||
@@ -16,9 +15,6 @@ function x-set-php-aliases
|
|||||||
# replace "php@" with "p" so "php@80" becomes "p80"
|
# replace "php@" with "p" so "php@80" becomes "p80"
|
||||||
local php_alias="${php_abbr//php@/p}"
|
local php_alias="${php_abbr//php@/p}"
|
||||||
|
|
||||||
# Skip php = php aliasing
|
|
||||||
# if [[ "$php_abbr" == "$php_alias" ]]; then continue; fi;
|
|
||||||
|
|
||||||
# Fetch the exec path once
|
# Fetch the exec path once
|
||||||
php_exec="$(brew --prefix "$version")/bin/php"
|
php_exec="$(brew --prefix "$version")/bin/php"
|
||||||
|
|
||||||
@@ -26,14 +22,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
|
||||||
}
|
}
|
||||||
@@ -42,6 +38,7 @@ if [[ $(uname) == 'Darwin' ]]; then
|
|||||||
|
|
||||||
x-set-php-aliases
|
x-set-php-aliases
|
||||||
|
|
||||||
|
# Laravel Sail shortcut
|
||||||
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
|
alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'
|
||||||
|
|
||||||
# Flush Directory Service cache
|
# Flush Directory Service cache
|
||||||
@@ -55,25 +52,34 @@ if [[ $(uname) == 'Darwin' ]]; then
|
|||||||
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias watchx='watch -dpbc' # watch with: differences, precise, beep and color
|
# watch with: differences, precise, beep and color
|
||||||
|
alias watchx='watch -dpbc'
|
||||||
|
# delete .DS_Store files
|
||||||
alias zapds='find . -name ".DS_Store" -print -delete'
|
alias zapds='find . -name ".DS_Store" -print -delete'
|
||||||
alias t='tail -f' # tail with follow flag on
|
# tail with follow flag on
|
||||||
alias dn='du -chd1' # directory usage, return only the total
|
alias t='tail -f'
|
||||||
|
# directory usage, return only the total
|
||||||
|
alias dn='du -chd1'
|
||||||
|
# Mirror site with wget
|
||||||
|
alias mirror_site='wget -m -k -K -E -e robots=off'
|
||||||
|
# Mirror stdout to stderr, useful for seeing data going through a pipe
|
||||||
|
alias peek='tee >(cat 1>&2)'
|
||||||
|
|
||||||
alias code_scanner="docker run \
|
alias code_scanner='docker run
|
||||||
--env SOURCE_CODE='${PWD}' \
|
--env SOURCE_CODE="$PWD"
|
||||||
--volume '${PWD}':/code \
|
--volume "${PWD}":/code
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||||
registry.gitlab.com/gitlab-org/ci-cd/codequality:${CODEQUALITY_VERSION:-latest} \
|
registry.gitlab.com/gitlab-org/ci-cd/codequality:"${CODEQUALITY_VERSION:-latest}"
|
||||||
/code"
|
/code'
|
||||||
|
|
||||||
alias composerUp='composer global update'
|
|
||||||
alias npmUp='npm -g up'
|
|
||||||
|
|
||||||
alias zedit='$EDITOR ~/.dotfiles'
|
alias zedit='$EDITOR ~/.dotfiles'
|
||||||
|
|
||||||
|
if hash irssi 2> /dev/null; then
|
||||||
|
# shellcheck disable=2139
|
||||||
|
alias irssi="irssi --config='$IRSSI_CONFIG_FILE' --home='$IRSSI_CONFIG_HOME'"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -f "$HOME/.aliases.local" ]]; then
|
if [[ -f "$HOME/.aliases.local" ]]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source "$HOME/.aliases.local"
|
source "$HOME/.aliases.local"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
233
config/dircolors
Normal file
233
config/dircolors
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
# Configuration file for dircolors, a utility to help you set the
|
||||||
|
# LS_COLORS environment variable used by GNU ls with the --color option.
|
||||||
|
# Copyright (C) 1996-2023 Free Software Foundation, Inc.
|
||||||
|
# Copying and distribution of this file, with or without modification,
|
||||||
|
# are permitted provided the copyright notice and this notice are preserved.
|
||||||
|
#
|
||||||
|
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
|
||||||
|
# slackware version of dircolors) are recognized but ignored.
|
||||||
|
# Global config options can be specified before TERM or COLORTERM entries
|
||||||
|
# ===================================================================
|
||||||
|
# Terminal filters
|
||||||
|
# ===================================================================
|
||||||
|
# Below are TERM or COLORTERM entries, which can be glob patterns, which
|
||||||
|
# restrict following config to systems with matching environment variables.
|
||||||
|
COLORTERM ?*
|
||||||
|
TERM Eterm
|
||||||
|
TERM ansi
|
||||||
|
TERM *color*
|
||||||
|
TERM con[0-9]*x[0-9]*
|
||||||
|
TERM cons25
|
||||||
|
TERM console
|
||||||
|
TERM cygwin
|
||||||
|
TERM *direct*
|
||||||
|
TERM dtterm
|
||||||
|
TERM gnome
|
||||||
|
TERM hurd
|
||||||
|
TERM jfbterm
|
||||||
|
TERM konsole
|
||||||
|
TERM kterm
|
||||||
|
TERM linux
|
||||||
|
TERM linux-c
|
||||||
|
TERM mlterm
|
||||||
|
TERM putty
|
||||||
|
TERM rxvt*
|
||||||
|
TERM screen*
|
||||||
|
TERM st
|
||||||
|
TERM terminator
|
||||||
|
TERM tmux*
|
||||||
|
TERM vt100
|
||||||
|
TERM xterm*
|
||||||
|
# ===================================================================
|
||||||
|
# Basic file attributes
|
||||||
|
# ===================================================================
|
||||||
|
# Below are the color init strings for the basic file types.
|
||||||
|
# One can use codes for 256 or more colors supported by modern terminals.
|
||||||
|
# The default color codes use the capabilities of an 8 color terminal
|
||||||
|
# with some additional attributes as per the following codes:
|
||||||
|
# Attribute codes:
|
||||||
|
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||||
|
# Text color codes:
|
||||||
|
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
|
||||||
|
# Background color codes:
|
||||||
|
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
|
||||||
|
#NORMAL 00 # no color code at all
|
||||||
|
#FILE 00 # regular file: use no color at all
|
||||||
|
RESET 0 # reset to "normal" color
|
||||||
|
DIR 01;34 # directory
|
||||||
|
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
|
||||||
|
# numerical value, the color is as for the file pointed to.)
|
||||||
|
MULTIHARDLINK 00 # regular file with more than one link
|
||||||
|
FIFO 40;33 # pipe
|
||||||
|
SOCK 01;35 # socket
|
||||||
|
DOOR 01;35 # door
|
||||||
|
BLK 40;33;01 # block device driver
|
||||||
|
CHR 40;33;01 # character device driver
|
||||||
|
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ...
|
||||||
|
MISSING 00 # ... and the files they point to
|
||||||
|
SETUID 37;41 # file that is setuid (u+s)
|
||||||
|
SETGID 30;43 # file that is setgid (g+s)
|
||||||
|
CAPABILITY 00 # file with capability (very expensive to lookup)
|
||||||
|
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
|
||||||
|
OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
|
||||||
|
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
|
||||||
|
# This is for files with execute permission:
|
||||||
|
EXEC 01;32
|
||||||
|
# ===================================================================
|
||||||
|
# File extension attributes
|
||||||
|
# ===================================================================
|
||||||
|
# List any file extensions like '.gz' or '.tar' that you would like ls
|
||||||
|
# to color below. Put the suffix, a space, and the color init string.
|
||||||
|
# (and any comments you want to add after a '#').
|
||||||
|
# Suffixes are matched case insensitively, but if you define different
|
||||||
|
# init strings for separate cases, those will be honored.
|
||||||
|
#
|
||||||
|
# If you use DOS-style suffixes, you may want to uncomment the following:
|
||||||
|
#.cmd 01;32 # executables (bright green)
|
||||||
|
#.exe 01;32
|
||||||
|
#.com 01;32
|
||||||
|
#.btm 01;32
|
||||||
|
#.bat 01;32
|
||||||
|
# Or if you want to color scripts even if they do not have the
|
||||||
|
# executable bit actually set.
|
||||||
|
#.sh 01;32
|
||||||
|
#.csh 01;32
|
||||||
|
# archives or compressed (bright red)
|
||||||
|
.tar 01;31
|
||||||
|
.tgz 01;31
|
||||||
|
.arc 01;31
|
||||||
|
.arj 01;31
|
||||||
|
.taz 01;31
|
||||||
|
.lha 01;31
|
||||||
|
.lz4 01;31
|
||||||
|
.lzh 01;31
|
||||||
|
.lzma 01;31
|
||||||
|
.tlz 01;31
|
||||||
|
.txz 01;31
|
||||||
|
.tzo 01;31
|
||||||
|
.t7z 01;31
|
||||||
|
.zip 01;31
|
||||||
|
.z 01;31
|
||||||
|
.dz 01;31
|
||||||
|
.gz 01;31
|
||||||
|
.lrz 01;31
|
||||||
|
.lz 01;31
|
||||||
|
.lzo 01;31
|
||||||
|
.xz 01;31
|
||||||
|
.zst 01;31
|
||||||
|
.tzst 01;31
|
||||||
|
.bz2 01;31
|
||||||
|
.bz 01;31
|
||||||
|
.tbz 01;31
|
||||||
|
.tbz2 01;31
|
||||||
|
.tz 01;31
|
||||||
|
.deb 01;31
|
||||||
|
.rpm 01;31
|
||||||
|
.jar 01;31
|
||||||
|
.war 01;31
|
||||||
|
.ear 01;31
|
||||||
|
.sar 01;31
|
||||||
|
.rar 01;31
|
||||||
|
.alz 01;31
|
||||||
|
.ace 01;31
|
||||||
|
.zoo 01;31
|
||||||
|
.cpio 01;31
|
||||||
|
.7z 01;31
|
||||||
|
.rz 01;31
|
||||||
|
.cab 01;31
|
||||||
|
.wim 01;31
|
||||||
|
.swm 01;31
|
||||||
|
.dwm 01;31
|
||||||
|
.esd 01;31
|
||||||
|
# image formats
|
||||||
|
.avif 01;35
|
||||||
|
.jpg 01;35
|
||||||
|
.jpeg 01;35
|
||||||
|
.mjpg 01;35
|
||||||
|
.mjpeg 01;35
|
||||||
|
.gif 01;35
|
||||||
|
.bmp 01;35
|
||||||
|
.pbm 01;35
|
||||||
|
.pgm 01;35
|
||||||
|
.ppm 01;35
|
||||||
|
.tga 01;35
|
||||||
|
.xbm 01;35
|
||||||
|
.xpm 01;35
|
||||||
|
.tif 01;35
|
||||||
|
.tiff 01;35
|
||||||
|
.png 01;35
|
||||||
|
.svg 01;35
|
||||||
|
.svgz 01;35
|
||||||
|
.mng 01;35
|
||||||
|
.pcx 01;35
|
||||||
|
.mov 01;35
|
||||||
|
.mpg 01;35
|
||||||
|
.mpeg 01;35
|
||||||
|
.m2v 01;35
|
||||||
|
.mkv 01;35
|
||||||
|
.webm 01;35
|
||||||
|
.webp 01;35
|
||||||
|
.ogm 01;35
|
||||||
|
.mp4 01;35
|
||||||
|
.m4v 01;35
|
||||||
|
.mp4v 01;35
|
||||||
|
.vob 01;35
|
||||||
|
.qt 01;35
|
||||||
|
.nuv 01;35
|
||||||
|
.wmv 01;35
|
||||||
|
.asf 01;35
|
||||||
|
.rm 01;35
|
||||||
|
.rmvb 01;35
|
||||||
|
.flc 01;35
|
||||||
|
.avi 01;35
|
||||||
|
.fli 01;35
|
||||||
|
.flv 01;35
|
||||||
|
.gl 01;35
|
||||||
|
.dl 01;35
|
||||||
|
.xcf 01;35
|
||||||
|
.xwd 01;35
|
||||||
|
.yuv 01;35
|
||||||
|
.cgm 01;35
|
||||||
|
.emf 01;35
|
||||||
|
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
|
||||||
|
.ogv 01;35
|
||||||
|
.ogx 01;35
|
||||||
|
# audio formats
|
||||||
|
.aac 00;36
|
||||||
|
.au 00;36
|
||||||
|
.flac 00;36
|
||||||
|
.m4a 00;36
|
||||||
|
.mid 00;36
|
||||||
|
.midi 00;36
|
||||||
|
.mka 00;36
|
||||||
|
.mp3 00;36
|
||||||
|
.mpc 00;36
|
||||||
|
.ogg 00;36
|
||||||
|
.ra 00;36
|
||||||
|
.wav 00;36
|
||||||
|
# https://wiki.xiph.org/MIME_Types_and_File_Extensions
|
||||||
|
.oga 00;36
|
||||||
|
.opus 00;36
|
||||||
|
.spx 00;36
|
||||||
|
.xspf 00;36
|
||||||
|
# backup files
|
||||||
|
*~ 00;90
|
||||||
|
*# 00;90
|
||||||
|
.bak 00;90
|
||||||
|
.old 00;90
|
||||||
|
.orig 00;90
|
||||||
|
.part 00;90
|
||||||
|
.rej 00;90
|
||||||
|
.swp 00;90
|
||||||
|
.tmp 00;90
|
||||||
|
.dpkg-dist 00;90
|
||||||
|
.dpkg-old 00;90
|
||||||
|
.ucf-dist 00;90
|
||||||
|
.ucf-new 00;90
|
||||||
|
.ucf-old 00;90
|
||||||
|
.rpmnew 00;90
|
||||||
|
.rpmorig 00;90
|
||||||
|
.rpmsave 00;90
|
||||||
|
#
|
||||||
|
# Subsequent TERM or COLORTERM entries, can be used to add / override
|
||||||
|
# config specific to those matching environment variables.
|
||||||
55
config/exports
Normal file → Executable file
55
config/exports
Normal file → Executable file
@@ -1,30 +1,43 @@
|
|||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck shell=zsh
|
||||||
|
# vim: filetype=zsh
|
||||||
|
|
||||||
export HIST_STAMPS="yyyy-mm-dd"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
export PATH="$DOTFILES/local/bin:$PATH"
|
||||||
|
|
||||||
# Larger bash history (allow 32³ entries; default is 500)
|
# Explicitly set XDG folders
|
||||||
export HISTSIZE=32768
|
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
export HISTFILESIZE=$HISTSIZE
|
export XDG_CONFIG_HOME="$HOME/.config"
|
||||||
# don't put duplicate lines or lines starting with space in the history.
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
# See bash(1) for more options
|
export XDG_STATE_HOME="$HOME/.local/state"
|
||||||
export HISTCONTROL=ignoreboth
|
|
||||||
|
|
||||||
# Make some commands not show up in history
|
# custom variables
|
||||||
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||||
|
export XDG_CACHE_HOME="$HOME/.cache"
|
||||||
|
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||||
|
|
||||||
# And include the parameter for ZSH
|
# Homebrew configuration
|
||||||
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
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
|
||||||
|
|
||||||
# Highlight section titles in manual pages
|
export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH"
|
||||||
export LESS_TERMCAP_md="$ORANGE"
|
|
||||||
|
|
||||||
# Don’t clear the screen after quitting a manual page
|
# brew, https://brew.sh
|
||||||
export MANPAGER="less -X"
|
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
|
||||||
|
|
||||||
# Always enable colored `grep` output
|
export PATH="$BREW_PYTHON:$GNUBIN_DIR:$BREW_GEMS:$BREW_RUBY:$PATH"
|
||||||
export GREP_OPTIONS="--color=auto"
|
fi
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
source "$DOTFILES/config/exports-shell"
|
||||||
# update the values of LINES and COLUMNS.
|
source "$DOTFILES/config/exports-apps"
|
||||||
hash shopt 2>/dev/null && shopt -s checkwinsize
|
|
||||||
|
|
||||||
|
if command -v nvim &> /dev/null; then
|
||||||
|
export EDITOR="nvim"
|
||||||
|
fi
|
||||||
|
|||||||
107
config/exports-apps
Executable file
107
config/exports-apps
Executable file
@@ -0,0 +1,107 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck shell=bash
|
||||||
|
# shellcheck enable=external-sources
|
||||||
|
# vim: filetype=zsh
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
# Ansible configuration
|
||||||
|
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
||||||
|
if hash ansible 2> /dev/null; then
|
||||||
|
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||||
|
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
|
||||||
|
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
||||||
|
x-dc "$ANSIBLE_HOME"
|
||||||
|
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
||||||
|
if command -v docker &> /dev/null; then
|
||||||
|
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
||||||
|
x-dc "$DOCKER_CONFIG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ffmpeg
|
||||||
|
if hash ffmpeg 2> /dev/null; then
|
||||||
|
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
|
||||||
|
x-dc "$FFMPEG_DATADIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# gcloud
|
||||||
|
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
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
x-dc "$GOPATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# irssi
|
||||||
|
if hash irssi 2> /dev/null; then
|
||||||
|
# These variables are used in ./alias with --config and --home
|
||||||
|
export IRSSI_CONFIG_HOME="$XDG_CONFIG_HOME/irssi"
|
||||||
|
export IRSSI_CONFIG_FILE="$IRSSI_CONFIG_HOME/config"
|
||||||
|
x-dc "$IRSSI_CONFIG_HOME"
|
||||||
|
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
|
||||||
|
|
||||||
|
# op (1Password cli) is present
|
||||||
|
if hash op 2> /dev/null; then
|
||||||
|
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||||
|
x-dc "$OP_CACHE"
|
||||||
|
eval "$(op completion zsh)"
|
||||||
|
compdef _op op
|
||||||
|
fi
|
||||||
|
|
||||||
|
# pyenv, python environments
|
||||||
|
if command -v pyenv &> /dev/null; then
|
||||||
|
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
|
||||||
|
x-dc "$PYENV_ROOT"
|
||||||
|
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
|
||||||
|
eval "$(pyenv init -)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# wakatime, https://github.com/wakatime/wakatime-cli
|
||||||
|
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||||
|
x-dc "$WAKATIME_HOME"
|
||||||
|
|
||||||
|
# z, https://github.com/rupa/z
|
||||||
|
export _Z_DATA="$XDG_STATE_HOME/z"
|
||||||
|
[[ -f "$XDG_BIN_HOME/z/z.sh" ]] && source "$XDG_BIN_HOME/z/z.sh"
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
||||||
|
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||||
|
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
||||||
|
|
||||||
6
config/exports-secret.example
Normal file
6
config/exports-secret.example
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# This file is secret and wont be added to the git repo.
|
||||||
|
|
||||||
|
export GITLAB_API_TOKEN=""
|
||||||
|
export GREN_GITHUB_TOKEN=""
|
||||||
55
config/exports-shell
Executable file
55
config/exports-shell
Executable file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck shell=bash
|
||||||
|
# vim: filetype=zsh
|
||||||
|
|
||||||
|
export LC_ALL=fi_FI.utf8
|
||||||
|
|
||||||
|
# Bash completion file location
|
||||||
|
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME}/bash-completion/bash_completion"
|
||||||
|
|
||||||
|
# History env variables
|
||||||
|
export HIST_STAMPS="yyyy-mm-dd"
|
||||||
|
# Larger bash history (allow 32³ entries; default is 500)
|
||||||
|
export HISTSIZE=32768
|
||||||
|
export HISTFILESIZE=$HISTSIZE
|
||||||
|
# don't put duplicate lines or lines starting with space in the history.
|
||||||
|
# See bash(1) for more options
|
||||||
|
export HISTCONTROL=ignoreboth
|
||||||
|
# Make some commands not show up in history
|
||||||
|
export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||||||
|
# And include the parameter for ZSH
|
||||||
|
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
||||||
|
|
||||||
|
# Highlight section titles in manual pages
|
||||||
|
export LESS_TERMCAP_md="$ORANGE"
|
||||||
|
|
||||||
|
# Don’t clear the screen after quitting a manual page
|
||||||
|
export MANPAGER="less -X"
|
||||||
|
|
||||||
|
# Always enable colored `grep` output
|
||||||
|
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
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
|
# Set dircolors based on the file, if it exists
|
||||||
|
if command -v dircolors &> /dev/null; then
|
||||||
|
# shellcheck disable=SC2046
|
||||||
|
eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If we are using zsh, color our dir lists and such
|
||||||
|
if [ "$SHELL" = "$(which zsh)" ]; then
|
||||||
|
x-dc "$XDG_CACHE_HOME/zsh"
|
||||||
|
x-dc "$XDG_STATE_HOME/zsh"
|
||||||
|
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||||||
|
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
||||||
|
zstyle ':completion:*' list-colors "$LS_COLORS"
|
||||||
|
fi
|
||||||
|
|
||||||
48
config/functions
Normal file → Executable file
48
config/functions
Normal file → Executable file
@@ -66,3 +66,51 @@ function silent
|
|||||||
"$@" >&/dev/null
|
"$@" >&/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Remove directory from the PATH variable
|
||||||
|
# usage: path_remove ~/.local/bin
|
||||||
|
function path_remove
|
||||||
|
{
|
||||||
|
PATH=$(echo -n "$PATH" | awk -v RS=: -v ORS=: "\$0 != \"$1\"" | sed 's/:$//')
|
||||||
|
}
|
||||||
|
|
||||||
|
# Append directory to the PATH
|
||||||
|
# usage: path_append ~/.local/bin
|
||||||
|
function path_append
|
||||||
|
{
|
||||||
|
path_remove "$1"
|
||||||
|
PATH="${PATH:+"$PATH:"}$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Prepend directory to the PATH
|
||||||
|
# usage: path_prepend ~/.local/bin
|
||||||
|
function path_prepend
|
||||||
|
{
|
||||||
|
path_remove "$1"
|
||||||
|
PATH="$1${PATH:+":$PATH"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Defines default antigen bundles
|
||||||
|
function x-default-antigen-bundles
|
||||||
|
{
|
||||||
|
# these should be always available
|
||||||
|
antigen bundle colored-man-pages
|
||||||
|
antigen bundle command-not-found
|
||||||
|
antigen bundle ssh-agent
|
||||||
|
antigen bundle MichaelAquilina/zsh-you-should-use
|
||||||
|
antigen bundle Sparragus/zsh-auto-nvm-use
|
||||||
|
antigen bundle jreese/zsh-titles
|
||||||
|
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||||
|
antigen bundle zsh-users/zsh-completions
|
||||||
|
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||||
|
|
||||||
|
# these should be available if there's need
|
||||||
|
hash git 2> /dev/null && antigen bundle git
|
||||||
|
hash brew 2> /dev/null && antigen bundle brew
|
||||||
|
hash docker 2> /dev/null && antigen bundle docker
|
||||||
|
hash docker-compose 2> /dev/null && antigen bundle sroze/docker-compose-zsh-plugin
|
||||||
|
hash jq 2> /dev/null && antigen bundle reegnz/jq-zsh-plugin
|
||||||
|
hash nvm 2> /dev/null && antigen bundle nvm
|
||||||
|
hash php 2> /dev/null && antigen bundle php
|
||||||
|
hash python 2> /dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||||
|
hash rvm 2> /dev/null && antigen bundle unixorn/rvm-plugin
|
||||||
|
}
|
||||||
|
|||||||
16
config/misc/screenrc
Normal file
16
config/misc/screenrc
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Disable the startup message
|
||||||
|
startup_message off
|
||||||
|
|
||||||
|
# Set a large scrollback buffer
|
||||||
|
defscrollback 32000
|
||||||
|
|
||||||
|
# Always start `screen` with UTF-8 enabled (`screen -U`)
|
||||||
|
defutf8 on
|
||||||
|
|
||||||
|
# Scroll with mouse wheel (http://stackoverflow.com/a/1125947)
|
||||||
|
termcapinfo xterm* ti@:te@
|
||||||
|
|
||||||
|
# Some settings for screen + vim
|
||||||
|
term xterm-256color
|
||||||
|
maptimeout 10
|
||||||
|
|
||||||
Submodule config/nvim updated: 291c43b0bd...8d142661f7
@@ -4,6 +4,9 @@
|
|||||||
# Inserts a blank line between shell prompts
|
# Inserts a blank line between shell prompts
|
||||||
add_newline = true
|
add_newline = true
|
||||||
|
|
||||||
|
# Timeout for commands executed by starship (in milliseconds).
|
||||||
|
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'
|
||||||
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
||||||
@@ -32,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}'
|
||||||
|
|
||||||
|
|||||||
Submodule dotbot-gh-extension deleted from 037994ef28
Submodule dotbot-golang deleted from 4fa60bd487
Submodule dotbot-if deleted from 2b4dc56943
Submodule dotbot-ifplatform deleted from e35b5c0d71
1
dotbot-include
Submodule
1
dotbot-include
Submodule
Submodule dotbot-include added at 6943c52125
0
hosts/air/base/.gitkeep
Normal file
0
hosts/air/base/.gitkeep
Normal file
0
hosts/air/config/.gitkeep
Normal file
0
hosts/air/config/.gitkeep
Normal file
15
hosts/air/install.conf.yaml
Normal file
15
hosts/air/install.conf.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring air"
|
||||||
|
- brewfile:
|
||||||
|
- Brewfile
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/air/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/air/config/**
|
||||||
9
hosts/defaults.yaml
Normal file
9
hosts/defaults.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
- defaults:
|
||||||
|
create:
|
||||||
|
mode: 0755
|
||||||
|
link:
|
||||||
|
create: true
|
||||||
|
relink: true
|
||||||
|
exclude: ["*.md", "*renovate*"]
|
||||||
|
shell:
|
||||||
|
stdout: true
|
||||||
0
hosts/lakka/base/.gitkeep
Normal file
0
hosts/lakka/base/.gitkeep
Normal file
50
hosts/lakka/base/zshrc
Normal file
50
hosts/lakka/base/zshrc
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Lakka zsh configuration.
|
||||||
|
#
|
||||||
|
# shellcheck shell=bash
|
||||||
|
export PATH="$HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
|
||||||
|
|
||||||
|
# Defaults
|
||||||
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|
||||||
|
# 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:$PATH"
|
||||||
|
export LC_ALL=fi_FI.utf8
|
||||||
|
|
||||||
|
export RVM_PATH="$HOME/.rvm"
|
||||||
|
export PATH="$RVM_PATH/bin:$PATH"
|
||||||
|
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||||
|
|
||||||
|
# Try to load antigen, if present
|
||||||
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||||
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||||
|
|
||||||
|
# If antigen was loaded
|
||||||
|
if command -v antigen &> /dev/null; then
|
||||||
|
antigen use oh-my-zsh
|
||||||
|
|
||||||
|
# config/functions
|
||||||
|
x-default-antigen-bundles
|
||||||
|
|
||||||
|
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
|
||||||
|
|
||||||
|
antigen apply
|
||||||
|
fi
|
||||||
|
|
||||||
|
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
||||||
|
alias nano='nano -wS -$'
|
||||||
|
alias gpg=gpg2
|
||||||
|
|
||||||
|
ACME_PATH="$HOME/.acme.sh"
|
||||||
|
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
|
||||||
0
hosts/lakka/config/.gitkeep
Normal file
0
hosts/lakka/config/.gitkeep
Normal file
17
hosts/lakka/install.conf.yaml
Normal file
17
hosts/lakka/install.conf.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring lakka"
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/lakka/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/lakka/config/**
|
||||||
|
~/.irssi/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/lakka/irssi/**
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
# Lakka zsh configuration.
|
|
||||||
#
|
|
||||||
# shellcheck shell=bash
|
|
||||||
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
|
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
||||||
# If antigen was loaded
|
|
||||||
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 jreese/zsh-titles
|
|
||||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
|
||||||
antigen bundle zsh-users/zsh-completions
|
|
||||||
antigen bundle unixorn/rvm-plugin
|
|
||||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
|
||||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" ]] # Load RVM into a shell session *as a function*
|
|
||||||
. "$HOME/.acme.sh/acme.sh.env"
|
|
||||||
0
hosts/tunkki/base/.gitkeep
Normal file
0
hosts/tunkki/base/.gitkeep
Normal file
@@ -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
|
|
||||||
|
|
||||||
0
hosts/tunkki/config/.gitkeep
Normal file
0
hosts/tunkki/config/.gitkeep
Normal file
13
hosts/tunkki/install.conf.yaml
Normal file
13
hosts/tunkki/install.conf.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring tunkki"
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/tunkki/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/tunkki/config/**
|
||||||
0
hosts/v/base/.gitkeep
Normal file
0
hosts/v/base/.gitkeep
Normal file
0
hosts/v/config/.gitkeep
Normal file
0
hosts/v/config/.gitkeep
Normal file
15
hosts/v/install.conf.yaml
Normal file
15
hosts/v/install.conf.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
- include: 'hosts/defaults.yaml'
|
||||||
|
- shell:
|
||||||
|
- echo "Configuring v"
|
||||||
|
- brewfile:
|
||||||
|
- Brewfile
|
||||||
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: hosts/v/base/**
|
||||||
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
force: true
|
||||||
|
path: hosts/v/config/**
|
||||||
22
install
22
install
@@ -7,17 +7,31 @@ 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}"
|
||||||
|
DOTBOT_HOST="$(hostname -s)" || ''
|
||||||
|
|
||||||
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-gh-extension \
|
--plugin-dir=dotbot-gh-extension \
|
||||||
--plugin-dir=dotbot-golang \
|
--plugin-dir=dotbot-include \
|
||||||
--plugin-dir=dotbot-if \
|
|
||||||
--plugin-dir=dotbot-ifplatform \
|
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|
||||||
|
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||||
|
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||||
|
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||||
|
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||||
|
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||||
|
&& "$DOTBOT_BIN_PATH" \
|
||||||
|
-d "$BASEDIR" \
|
||||||
|
--plugin-dir=dotbot-brew \
|
||||||
|
--plugin-dir=dotbot-gh-extension \
|
||||||
|
--plugin-dir=dotbot-include \
|
||||||
|
-c "$DOTBOT_HOST_CONFIG" \
|
||||||
|
"${@}"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -7,19 +7,27 @@ 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_HOST="$(hostname -s)" || ''
|
||||||
|
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-include \
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-brew \
|
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-gh-extension \
|
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-golang \
|
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-if \
|
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||||
# --plugin-dir=dotbot-plugins/dotbot-ifplatform \
|
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||||
# -p dotbot-plugins/dotbot-if/if.py \
|
&& "$DOTBOT_BIN_PATH" \
|
||||||
|
-d "$BASEDIR" \
|
||||||
|
--plugin-dir=dotbot-include \
|
||||||
|
-c "$DOTBOT_HOST_CONFIG" \
|
||||||
|
"${@}"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
- defaults:
|
- include: 'hosts/defaults.yaml'
|
||||||
brewfile:
|
|
||||||
stderr: true
|
|
||||||
stdout: true
|
|
||||||
create:
|
|
||||||
mode: 0755
|
|
||||||
link:
|
|
||||||
create: true
|
|
||||||
relink: true
|
|
||||||
exclude: ["*.md"]
|
|
||||||
- clean:
|
- clean:
|
||||||
~/:
|
~/:
|
||||||
~/.config:
|
~/.config:
|
||||||
@@ -15,101 +6,33 @@
|
|||||||
~/.local:
|
~/.local:
|
||||||
recursive: true
|
recursive: true
|
||||||
- create:
|
- create:
|
||||||
|
~/.cache:
|
||||||
|
~/.cache/git:
|
||||||
~/.config:
|
~/.config:
|
||||||
~/.local:
|
~/.local:
|
||||||
|
~/.local/run:
|
||||||
~/.local/share:
|
~/.local/share:
|
||||||
~/.local/state:
|
~/.local/state:
|
||||||
~/.ssh:
|
~/.ssh:
|
||||||
mode: 0700
|
mode: 0700
|
||||||
~/Code:
|
~/Code:
|
||||||
- link:
|
- link:
|
||||||
|
~/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
path: base/**
|
||||||
|
prefix: "."
|
||||||
~/.config/:
|
~/.config/:
|
||||||
glob: true
|
glob: true
|
||||||
path: config/*
|
path: config/**
|
||||||
~/.local/bin/:
|
~/.local/bin/:
|
||||||
glob: true
|
glob: true
|
||||||
path: local/bin/*
|
path: local/bin/**
|
||||||
~/.ssh/:
|
~/.ssh/:
|
||||||
force: true
|
force: true
|
||||||
glob: true
|
glob: true
|
||||||
mode: 0600
|
mode: 0600
|
||||||
path: ssh/*
|
path: ssh/**
|
||||||
~/:
|
|
||||||
force: true
|
|
||||||
glob: true
|
|
||||||
path: base/*
|
|
||||||
prefix: "."
|
|
||||||
- shell:
|
- shell:
|
||||||
- [git submodule update --init --recursive --force]
|
- git submodule update --init --recursive --force
|
||||||
- [chsh -s $(which zsh), Making zsh the default shell]
|
- bash local/bin/dfm install all
|
||||||
- ifmacos:
|
|
||||||
- shell:
|
|
||||||
- [bash scripts/set-macos-defaults.sh]
|
|
||||||
- brewfile:
|
|
||||||
- Brewfile
|
|
||||||
# Go packages what should be included in every system
|
|
||||||
- go:
|
|
||||||
- github.com/skx/sysbox@latest
|
|
||||||
- github.com/dotzero/git-profile
|
|
||||||
- github.com/google/yamlfmt/cmd/yamlfmt@latest
|
|
||||||
# hosts!
|
|
||||||
## hosts: air
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = air ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
force: true
|
|
||||||
path: hosts/air/config/**
|
|
||||||
## hosts: v
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = v ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
force: true
|
|
||||||
path: hosts/v/config/**
|
|
||||||
## hosts: tunkki
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = tunkki ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
force: true
|
|
||||||
path: hosts/tunkki/config/**
|
|
||||||
## hosts: lakka
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = lakka ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.irssi/*:
|
|
||||||
force: true
|
|
||||||
glob: true
|
|
||||||
path: hosts/lakka/irssi/**
|
|
||||||
~/.zshrc:
|
|
||||||
force: true
|
|
||||||
path: hosts/lakka/zshrc
|
|
||||||
# GitHub CLI Extensions
|
|
||||||
- ghe:
|
|
||||||
# GitHub CLI extension for generating a report on repository dependencies.
|
|
||||||
- andyfeller/gh-dependency-report
|
|
||||||
# GitHub CLI extension to generate montage from GitHub user avatars
|
|
||||||
- andyfeller/gh-montage
|
|
||||||
# An opinionated GitHub Cli extension for creating
|
|
||||||
# changelogs that adhere to the keep a changelog specification.
|
|
||||||
- chelnak/gh-changelog
|
|
||||||
# Safely deletes local branches with no upstream and no un-pushed commits
|
|
||||||
- davidraviv/gh-clean-branches
|
|
||||||
# A beautiful CLI dashboard for GitHub 🚀
|
|
||||||
- dlvhdr/gh-dash
|
|
||||||
# A github-cli extension script to clone all repositories
|
|
||||||
# in an organization, optionally filtering by topic.
|
|
||||||
- matt-bartel/gh-clone-org
|
|
||||||
# being an extension to view the overall health of
|
|
||||||
# an organization's use of actions
|
|
||||||
- rsese/gh-actions-status
|
|
||||||
|
|
||||||
#
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
SCRIPT=$(basename "$0")
|
SCRIPT=$(basename "$0")
|
||||||
|
|
||||||
|
VERSION_NVM="v0.39.3"
|
||||||
|
|
||||||
# shellcheck source=./../../scripts/shared.sh
|
# shellcheck source=./../../scripts/shared.sh
|
||||||
source "$DOTFILES/scripts/shared.sh"
|
source "$DOTFILES/scripts/shared.sh"
|
||||||
|
|
||||||
@@ -24,39 +26,87 @@ 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 brew install
|
||||||
|
$0 install composer
|
||||||
|
$0 install dotenv
|
||||||
|
$0 install gh
|
||||||
|
$0 install go
|
||||||
|
$0 install imagick
|
||||||
$0 install nvm
|
$0 install nvm
|
||||||
$0 install macos
|
|
||||||
$0 install npm
|
$0 install npm
|
||||||
|
$0 install ntfy
|
||||||
|
$0 install z
|
||||||
;;
|
;;
|
||||||
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!"
|
||||||
|
;;
|
||||||
|
composer)
|
||||||
|
bash "$DOTFILES/scripts/install-composer.sh" \
|
||||||
|
&& msg_done "🎉 composer installed!"
|
||||||
|
;;
|
||||||
|
dotenv)
|
||||||
|
curl -sSfL \
|
||||||
|
https://raw.githubusercontent.com/dotenv-linter/dotenv-linter/master/install.sh \
|
||||||
|
| sh -s -- -b "$XDG_BIN_HOME" \
|
||||||
|
&& msg_done "🎉 dotenv-linter installed!"
|
||||||
|
;;
|
||||||
|
gh)
|
||||||
|
bash "$DOTFILES/scripts/install-gh-extensions.sh" \
|
||||||
|
&& msg_done "🎉 github cli extensions installed!"
|
||||||
|
;;
|
||||||
|
go)
|
||||||
|
bash "$DOTFILES/scripts/install-go-packages.sh" \
|
||||||
|
&& msg_done "🎉 go packages installed!"
|
||||||
|
;;
|
||||||
|
imagick)
|
||||||
|
wget https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \
|
||||||
|
&& msg_done "🎉 imagick 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/$VERSION_NVM/install.sh" | bash \
|
||||||
|
&& nvm install --lts --latest-npm --default \
|
||||||
|
&& git checkout "$HOME/.zshrc" \
|
||||||
|
&& 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)
|
ntfy)
|
||||||
bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Settler has been run!"
|
bash "$DOTFILES/scripts/install-ntfy.sh" \
|
||||||
|
&& msg_done "🎉 ntfy installed!"
|
||||||
|
;;
|
||||||
|
z)
|
||||||
|
bash "$DOTFILES/scripts/install-z.sh" \
|
||||||
|
&& msg_done "🎉 z has been installed!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
menu_section "$USAGE_PREFIX" "all | antigen | starship | nvm | npm | macos | settler"
|
menu_section "$USAGE_PREFIX" "all | antigen | composer | dotenv | gh | go | imagick | starship | macos | nvm | npm"
|
||||||
menu_item "all" "Installs antigen, macos, brew and ext_gh"
|
menu_item "all" "Installs macos defaults, antigen, starship, brew, nvm, npm packages and others"
|
||||||
menu_item "antigen" "Updates the antigen.zsh file"
|
menu_item "antigen" "Updates the antigen.zsh file"
|
||||||
|
menu_item "composer" "Install composer"
|
||||||
|
menu_item "dotenv" "Install dotenv-linter"
|
||||||
|
menu_item "gh" "Install GitHub CLI Extensions"
|
||||||
|
menu_item "go" "Install Go Packages"
|
||||||
|
menu_item "imagick" "Install ImageMagick CLI"
|
||||||
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 "ntfy" "Install ntfy"
|
||||||
menu_item "settler" "Runs the WIP settler.sh"
|
menu_item "z" "Install z"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -103,6 +153,12 @@ function section_dotfiles
|
|||||||
USAGE_PREFIX="$SCRIPT dotfiles"
|
USAGE_PREFIX="$SCRIPT dotfiles"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
fmt)
|
||||||
|
msg_ok "Running all formatters"
|
||||||
|
$0 dotfiles yamlfmt
|
||||||
|
$0 dotfiles shfmt
|
||||||
|
msg_done "...done!"
|
||||||
|
;;
|
||||||
reset_all)
|
reset_all)
|
||||||
msg_ok "Running all reset commands"
|
msg_ok "Running all reset commands"
|
||||||
$0 dotfiles reset_nvim
|
$0 dotfiles reset_nvim
|
||||||
@@ -120,7 +176,7 @@ function section_dotfiles
|
|||||||
msg_ok "Linked nvim and astronvim"
|
msg_ok "Linked nvim and astronvim"
|
||||||
hash npm 2> /dev/null && $0 install npm
|
hash npm 2> /dev/null && $0 install npm
|
||||||
msg_ok "Installed packages"
|
msg_ok "Installed packages"
|
||||||
msg_done "...and we are done!"
|
msg_done "nvim reset!"
|
||||||
;;
|
;;
|
||||||
yamlfmt)
|
yamlfmt)
|
||||||
# format yaml files
|
# format yaml files
|
||||||
@@ -134,15 +190,18 @@ 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" "fmt | reset_all | reset_nvim | yamlfmt | shfmt"
|
||||||
|
menu_item "fmt" "Run all formatters"
|
||||||
menu_item "reset_all" "Reset everything, runs all configured reset actions"
|
menu_item "reset_all" "Reset everything, runs all configured reset actions"
|
||||||
menu_item "reset_nvim" "Resets nvim. Deletes caches, removes nvim folders and relinks nvim folders"
|
menu_item "reset_nvim" "Resets nvim. Deletes caches, removes nvim folders and relinks nvim folders"
|
||||||
menu_item "yamlfmt" "Run yamlfmt to all dotfiles, which are in our control"
|
menu_item "yamlfmt" "Run yamlfmt to all dotfiles, which are in our control"
|
||||||
|
|||||||
57
local/bin/x-compare-versions.py
Executable file
57
local/bin/x-compare-versions.py
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
"""
|
||||||
|
Version Comparison tool for the CLI.
|
||||||
|
|
||||||
|
Adapted from script found in anishathalye's dotfiles.
|
||||||
|
https://github.com/anishathalye/dotfiles/blob/master/bin/vercmp
|
||||||
|
"""
|
||||||
|
|
||||||
|
import operator
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from packaging import version
|
||||||
|
|
||||||
|
str_to_operator = {
|
||||||
|
"==": operator.eq,
|
||||||
|
"!=": operator.ne,
|
||||||
|
"<": operator.lt,
|
||||||
|
"<=": operator.le,
|
||||||
|
">": operator.gt,
|
||||||
|
">=": operator.ge,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def vercmp(expr):
|
||||||
|
"""Version Comparison function."""
|
||||||
|
words = expr.split()
|
||||||
|
comparisons = [words[i: i + 3] for i in range(0, len(words) - 2, 2)]
|
||||||
|
for left, op_str, right in comparisons:
|
||||||
|
compare_op = str_to_operator[op_str]
|
||||||
|
if not compare_op(version.parse(left), version.parse(right)):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Triggers version comparison if line is provided."""
|
||||||
|
for line in sys.stdin:
|
||||||
|
if not vercmp(line):
|
||||||
|
sys.exit(1)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
def test():
|
||||||
|
"""Basic functionality tests."""
|
||||||
|
assert not vercmp("1.9 >= 2.4")
|
||||||
|
assert vercmp("2.4 >= 2.4")
|
||||||
|
assert vercmp("2.5 >= 2.4")
|
||||||
|
assert vercmp("3 >= 2.999")
|
||||||
|
assert vercmp("2.9 < 2.9a")
|
||||||
|
assert vercmp("2.9a >= 2.8")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) == 2 and sys.argv[1] == "test":
|
||||||
|
test()
|
||||||
|
else:
|
||||||
|
main()
|
||||||
14
local/bin/x-dc
Executable file
14
local/bin/x-dc
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Verify folder exists, and if it does not, create it.
|
||||||
|
|
||||||
|
dir="$1"
|
||||||
|
|
||||||
|
[ $# -eq 0 ] && {
|
||||||
|
echo "Usage: $0 full/path/to/dir/to/create"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -d "$dir" ]; then
|
||||||
|
mkdir -p "$dir" && exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
5
local/bin/x-ip
Executable file
5
local/bin/x-ip
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Source: https://github.com/thirtythreeforty/dotfiles/blob/master/bin/extip
|
||||||
|
|
||||||
|
curl icanhazip.com "${@}"
|
||||||
|
|
||||||
39
local/bin/x-thumbgen
Executable file
39
local/bin/x-thumbgen
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Generate thumbnails using magick
|
||||||
|
# https://imagemagick.org/script/download.php
|
||||||
|
#
|
||||||
|
# Defaults to current directory creating thumbs with 1000x1000
|
||||||
|
# images with 200px white borders around the original image.
|
||||||
|
#
|
||||||
|
# Defaults can be overridden with ENV variables like this:
|
||||||
|
# $ THMB_BACKGROUND=black x-thumbgen ~/images/
|
||||||
|
#
|
||||||
|
# Created by: Ismo Vuorinen <https://github.com/ivuorinen> 2015
|
||||||
|
|
||||||
|
: "${THMB_SOURCE:=$1}"
|
||||||
|
: "${THMB_BACKGROUND:=white}"
|
||||||
|
: "${THMB_RESIZE:=800x800}"
|
||||||
|
: "${THMB_EXTENT:=1000x1000}"
|
||||||
|
|
||||||
|
[ $# -eq 0 ] && {
|
||||||
|
echo "Usage: $0 /full/path/to/image/folder"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$THMB_SOURCE" == "" ] || [ ! -d "$THMB_SOURCE" ]; then
|
||||||
|
THMB_SOURCE=$(pwd)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v magick &> /dev/null; then
|
||||||
|
|
||||||
|
magick \
|
||||||
|
"$THMB_SOURCE/*" \
|
||||||
|
-resize "$THMB_RESIZE" \
|
||||||
|
-background "$THMB_BACKGROUND" \
|
||||||
|
-gravity center \
|
||||||
|
-extent "$THMB_EXTENT" \
|
||||||
|
-set filename:fname '%t_thumb.%e' +adjoin '%[filename:fname]'
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "magick not found in PATH, https://imagemagick.org/script/download.php"
|
||||||
|
fi
|
||||||
19
scripts/install-composer.sh
Executable file
19
scripts/install-composer.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
44
scripts/install-gh-extensions.sh
Executable file
44
scripts/install-gh-extensions.sh
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Install GitHub CLI extensions
|
||||||
|
#
|
||||||
|
# shellcheck source="shared.sh"
|
||||||
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
|
if ! command -v gh &> /dev/null; then
|
||||||
|
msg_run "gh (GitHub Client) could not be found, please install it first"
|
||||||
|
else
|
||||||
|
extensions=(
|
||||||
|
# GitHub CLI extension for generating a report on repository dependencies.
|
||||||
|
andyfeller/gh-dependency-report
|
||||||
|
# GitHub CLI extension to generate montage from GitHub user avatars
|
||||||
|
andyfeller/gh-montage
|
||||||
|
# An opinionated GitHub Cli extension for creating
|
||||||
|
# changelogs that adhere to the keep a changelog specification.
|
||||||
|
chelnak/gh-changelog
|
||||||
|
# Safely deletes local branches with no upstream and no un-pushed commits
|
||||||
|
davidraviv/gh-clean-branches
|
||||||
|
# A beautiful CLI dashboard for GitHub 🚀
|
||||||
|
dlvhdr/gh-dash
|
||||||
|
# A github-cli extension script to clone all repositories
|
||||||
|
# in an organization, optionally filtering by topic.
|
||||||
|
matt-bartel/gh-clone-org
|
||||||
|
# being an extension to view the overall health of
|
||||||
|
# an organization's use of actions
|
||||||
|
rsese/gh-actions-status
|
||||||
|
)
|
||||||
|
|
||||||
|
msg "Starting to install GitHub CLI extensions..."
|
||||||
|
|
||||||
|
for ext in "${extensions[@]}"; do
|
||||||
|
# Trim spaces
|
||||||
|
ext=${ext// /}
|
||||||
|
# Skip comments
|
||||||
|
if [[ ${ext:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
|
msg_run "Installing $ext"
|
||||||
|
gh extensions install "$ext"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
fi
|
||||||
32
scripts/install-go-packages.sh
Executable file
32
scripts/install-go-packages.sh
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Install Go packages
|
||||||
|
#
|
||||||
|
# shellcheck source=shared.sh
|
||||||
|
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||||
|
|
||||||
|
if ! command -v go &> /dev/null; then
|
||||||
|
msg "go hasn't been installed yet."
|
||||||
|
else
|
||||||
|
packages=(
|
||||||
|
# sysadmin/scripting utilities, distributed as a single binary
|
||||||
|
github.com/skx/sysbox@latest
|
||||||
|
github.com/dotzero/git-profile@latest
|
||||||
|
github.com/google/yamlfmt/cmd/yamlfmt@latest
|
||||||
|
github.com/ericchiang/pup@latest
|
||||||
|
github.com/suntong/html2md@latest
|
||||||
|
)
|
||||||
|
|
||||||
|
for pkg in "${packages[@]}"; do
|
||||||
|
# Trim spaces
|
||||||
|
pkg=${pkg// /}
|
||||||
|
# Skip comments
|
||||||
|
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||||
|
|
||||||
|
msg_run "Installing go package:" "$pkg"
|
||||||
|
go install "$pkg"
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
msg_ok "Done"
|
||||||
|
|
||||||
|
fi
|
||||||
33
scripts/install-ntfy.sh
Executable file
33
scripts/install-ntfy.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! command -v ntfy &> /dev/null; then
|
||||||
|
case $(dfm check arch) in
|
||||||
|
Linux)
|
||||||
|
NTFY_ARCH="linux_$(arch)"
|
||||||
|
;;
|
||||||
|
Darwin)
|
||||||
|
NTFY_ARCH="macOS_all"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
NTFY_VERSION=2.2.0
|
||||||
|
NTFY_URL="https://github.com/binwiederhier/ntfy"
|
||||||
|
NTFY_DEST="ntfy_${NTFY_VERSION}_${NTFY_ARCH}"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
# copy config only if it does not exist
|
||||||
|
if [ ! -f "$HOME/.config/ntfy/client.yml" ]; then
|
||||||
|
cp "${NTFY_DEST}/client/client.yml" ~/.config/ntfy/client.yml
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf "${NTFY_DEST}" "${NTFY_DEST}.tar.gz"
|
||||||
|
else
|
||||||
|
echo "ntfy already installed"
|
||||||
|
fi
|
||||||
10
scripts/install-z.sh
Executable file
10
scripts/install-z.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
Z_GIT_PATH="https://github.com/rupa/z.git"
|
||||||
|
Z_BIN_PATH="$XDG_BIN_HOME/z"
|
||||||
|
|
||||||
|
if [ ! -d "$Z_BIN_PATH" ]; then
|
||||||
|
git clone "$Z_GIT_PATH" "$Z_BIN_PATH"
|
||||||
|
else
|
||||||
|
echo "z ($Z_BIN_PATH/) already installed"
|
||||||
|
fi
|
||||||
@@ -19,6 +19,11 @@ while true; do
|
|||||||
kill -0 "$$" || exit
|
kill -0 "$$" || exit
|
||||||
done 2> /dev/null &
|
done 2> /dev/null &
|
||||||
|
|
||||||
|
# Change user shell to zsh if not that already.
|
||||||
|
if hash zsh 2> /dev/null; then
|
||||||
|
[[ "$SHELL" != $(which zsh) ]] && chsh -s "$(which zsh)"
|
||||||
|
fi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# General UI/UX #
|
# General UI/UX #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user