mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-01 20:47:42 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f5f79d270 | |||
| dcd042262f | |||
| 268fd35bdb | |||
| 38a6f6f8e4 | |||
| d504fc5f2b | |||
| 4b1feb16fc | |||
| 9331b2b643 | |||
| 5ce9906ff1 | |||
| dbadcc3b6c | |||
|
|
4f2fd3cfd6 | ||
| 9621c67866 | |||
| 5e59893281 | |||
| ea292de853 | |||
| d2cedd0fee | |||
| 995cc569e7 | |||
| cceeba3f8e | |||
| dd3640586e | |||
|
|
11969bf791 | ||
|
|
bb3f4a8f6c | ||
|
|
6395895beb | ||
|
|
fa3dc531a0 | ||
| bb7ba3c919 | |||
| 53d91f8248 |
@@ -8,9 +8,24 @@ indent_style = space
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[*.yaml,*.yml]
|
[*.lua]
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.yaml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
[local/bin/antigen.zsh]
|
[*.yml]
|
||||||
ignore = true
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.sh]
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
shell_variant = bash # --language-variant
|
||||||
|
binary_next_line = true
|
||||||
|
switch_case_indent = true # --case-indent
|
||||||
|
space_redirects = false
|
||||||
|
keep_padding = false
|
||||||
|
function_next_line = true # --func-next-line
|
||||||
|
|||||||
6
.github/workflows/linters.yml
vendored
6
.github/workflows/linters.yml
vendored
@@ -1,30 +1,26 @@
|
|||||||
name: reviewdog
|
name: reviewdog
|
||||||
on: [ push ]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
linters:
|
linters:
|
||||||
name: Linters
|
name: Linters
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: GitHub Actions
|
- name: GitHub Actions
|
||||||
uses: reviewdog/action-actionlint@v1
|
uses: reviewdog/action-actionlint@v1
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
reporter: github-pr-review
|
reporter: github-pr-review
|
||||||
|
|
||||||
- name: detect-secrets
|
- name: detect-secrets
|
||||||
uses: reviewdog/action-detect-secrets@master
|
uses: reviewdog/action-detect-secrets@master
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
reporter: github-pr-review
|
reporter: github-pr-review
|
||||||
|
|
||||||
- name: markdownlint
|
- name: markdownlint
|
||||||
uses: reviewdog/action-markdownlint@v0
|
uses: reviewdog/action-markdownlint@v0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
reporter: github-pr-review
|
reporter: github-pr-review
|
||||||
|
|
||||||
- name: shfmt
|
- name: shfmt
|
||||||
uses: reviewdog/action-shfmt@v1
|
uses: reviewdog/action-shfmt@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
|||||||
Brewfile.lock.json
|
Brewfile.lock.json
|
||||||
*.log
|
*.log
|
||||||
|
*-secret
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
|||||||
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
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3
|
||||||
24
.yamlfmt
Normal file
24
.yamlfmt
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
formatter:
|
||||||
|
type: basic
|
||||||
|
indent: 2
|
||||||
|
retain_line_breaks: false
|
||||||
|
disallow_anchors: false
|
||||||
|
max_line_length: 0
|
||||||
|
scan_folded_as_literal: false
|
||||||
|
indentless_arrays: false
|
||||||
|
|
||||||
|
doublestar: true
|
||||||
|
|
||||||
|
extensions:
|
||||||
|
- yaml
|
||||||
|
- yml
|
||||||
|
|
||||||
|
include:
|
||||||
|
- ./*.{yml,yaml}
|
||||||
|
- ./**/*.{yml,yaml}
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- ./dotbot/**
|
||||||
|
- ./dotbot-*/**
|
||||||
|
- ./config/astronvim/**
|
||||||
|
- ./config/nvim/**
|
||||||
61
Brewfile
61
Brewfile
@@ -10,14 +10,21 @@ tap "homebrew/cask"
|
|||||||
tap "homebrew/cask-fonts"
|
tap "homebrew/cask-fonts"
|
||||||
tap "homebrew/core"
|
tap "homebrew/core"
|
||||||
tap "homebrew/services"
|
tap "homebrew/services"
|
||||||
|
tap "jesseduffield/lazygit"
|
||||||
tap "mongodb/brew"
|
tap "mongodb/brew"
|
||||||
tap "shivammathur/extensions"
|
tap "shivammathur/extensions"
|
||||||
tap "shivammathur/php"
|
tap "shivammathur/php"
|
||||||
tap "teamookla/speedtest"
|
tap "teamookla/speedtest"
|
||||||
|
# Interpreted, interactive, object-oriented programming language
|
||||||
|
brew "python@3.11"
|
||||||
# Automate deployment, configuration, and upgrading
|
# Automate deployment, configuration, and upgrading
|
||||||
brew "ansible"
|
brew "ansible"
|
||||||
|
# Checks ansible playbooks for practices and behaviour
|
||||||
|
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
|
||||||
@@ -26,6 +33,10 @@ 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
|
||||||
|
brew "bottom"
|
||||||
# Switch Apache / Valet / CLI configs between PHP versions
|
# Switch Apache / Valet / CLI configs between PHP versions
|
||||||
brew "brew-php-switcher"
|
brew "brew-php-switcher"
|
||||||
# Core application library for C
|
# Core application library for C
|
||||||
@@ -34,30 +45,22 @@ brew "glib"
|
|||||||
brew "pkg-config"
|
brew "pkg-config"
|
||||||
# Cross-platform make
|
# Cross-platform make
|
||||||
brew "cmake"
|
brew "cmake"
|
||||||
# Open source suite of directory software
|
|
||||||
brew "openldap"
|
|
||||||
# Get a file from an HTTP, HTTPS or FTP server
|
|
||||||
brew "curl"
|
|
||||||
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
|
||||||
brew "freetds"
|
|
||||||
# C/C++ and Java libraries for Unicode and globalization
|
|
||||||
brew "icu4c"
|
|
||||||
# Postgres C API library
|
|
||||||
brew "libpq"
|
|
||||||
# General-purpose scripting language
|
|
||||||
brew "php"
|
|
||||||
# Dependency Manager for PHP
|
|
||||||
brew "composer"
|
|
||||||
# GNU File, Shell, and Text utilities
|
# GNU File, Shell, and Text utilities
|
||||||
brew "coreutils"
|
brew "coreutils"
|
||||||
# Get, unpack, build, and install modules from CPAN
|
# Get, unpack, build, and install modules from CPAN
|
||||||
brew "cpanminus"
|
brew "cpanminus"
|
||||||
|
# Open source suite of directory software
|
||||||
|
brew "openldap"
|
||||||
|
# Get a file from an HTTP, HTTPS or FTP server
|
||||||
|
brew "curl"
|
||||||
# Diff that understands syntax
|
# Diff that understands syntax
|
||||||
brew "difftastic"
|
brew "difftastic"
|
||||||
# Tool for exploring each layer in a docker image
|
# Tool for exploring each layer in a docker image
|
||||||
brew "dive"
|
brew "dive"
|
||||||
# Command-line DNS client
|
# Command-line DNS client
|
||||||
brew "dog"
|
brew "dog"
|
||||||
|
# Lightning-fast linter for .env files written in Rust
|
||||||
|
brew "dotenv-linter"
|
||||||
# Tool to verify that your files are in harmony with your .editorconfig
|
# Tool to verify that your files are in harmony with your .editorconfig
|
||||||
brew "editorconfig-checker"
|
brew "editorconfig-checker"
|
||||||
# Useful examples at the command-line
|
# Useful examples at the command-line
|
||||||
@@ -66,8 +69,12 @@ brew "eg-examples"
|
|||||||
brew "faas-cli"
|
brew "faas-cli"
|
||||||
# Simple, fast and user-friendly alternative to find
|
# Simple, fast and user-friendly alternative to find
|
||||||
brew "fd"
|
brew "fd"
|
||||||
|
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
||||||
|
brew "freetds"
|
||||||
# Monitor a directory for changes and run a shell command
|
# Monitor a directory for changes and run a shell command
|
||||||
brew "fswatch"
|
brew "fswatch"
|
||||||
|
# Disk usage analyzer with console interface written in Go
|
||||||
|
brew "gdu", link: false
|
||||||
# GitHub command-line tool
|
# GitHub command-line tool
|
||||||
brew "gh"
|
brew "gh"
|
||||||
# Distributed revision control system
|
# Distributed revision control system
|
||||||
@@ -92,8 +99,12 @@ brew "gnupg"
|
|||||||
brew "go"
|
brew "go"
|
||||||
# Image manipulation
|
# Image manipulation
|
||||||
brew "netpbm"
|
brew "netpbm"
|
||||||
|
# C/C++ and Java libraries for Unicode and globalization
|
||||||
|
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
|
||||||
@@ -114,6 +125,8 @@ brew "imagemagick"
|
|||||||
brew "jq"
|
brew "jq"
|
||||||
# Lazier way to manage everything docker
|
# Lazier way to manage everything docker
|
||||||
brew "lazydocker"
|
brew "lazydocker"
|
||||||
|
# Postgres C API library
|
||||||
|
brew "libpq"
|
||||||
# Linguistic software and Finnish dictionary
|
# Linguistic software and Finnish dictionary
|
||||||
brew "libvoikko"
|
brew "libvoikko"
|
||||||
# Package manager for the Lua programming language
|
# Package manager for the Lua programming language
|
||||||
@@ -140,6 +153,14 @@ brew "openapi-generator"
|
|||||||
brew "pandoc"
|
brew "pandoc"
|
||||||
# Highly capable, feature-rich programming language
|
# Highly capable, feature-rich programming language
|
||||||
brew "perl"
|
brew "perl"
|
||||||
|
# General-purpose scripting language
|
||||||
|
brew "php@8.1"
|
||||||
|
# Python version management
|
||||||
|
brew "pyenv"
|
||||||
|
# Migrate pip packages from one Python version to another
|
||||||
|
brew "pyenv-pip-migrate"
|
||||||
|
# Pyenv plugin to manage virtualenv
|
||||||
|
brew "pyenv-virtualenv"
|
||||||
# Interpreted, interactive, object-oriented programming language
|
# Interpreted, interactive, object-oriented programming language
|
||||||
brew "python@3.10"
|
brew "python@3.10"
|
||||||
# Interpreted, interactive, object-oriented programming language
|
# Interpreted, interactive, object-oriented programming language
|
||||||
@@ -168,6 +189,8 @@ brew "terragrunt"
|
|||||||
brew "testssl"
|
brew "testssl"
|
||||||
# Terraform version manager inspired by rbenv
|
# Terraform version manager inspired by rbenv
|
||||||
brew "tfenv"
|
brew "tfenv"
|
||||||
|
# Static analysis security scanner for your terraform code
|
||||||
|
brew "tfsec"
|
||||||
# Programmatically correct mistyped console commands
|
# Programmatically correct mistyped console commands
|
||||||
brew "thefuck"
|
brew "thefuck"
|
||||||
# Simplified and community-driven man pages
|
# Simplified and community-driven man pages
|
||||||
@@ -176,8 +199,12 @@ 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
|
||||||
|
brew "virtualenv"
|
||||||
# Command-line interface to the WakaTime api
|
# Command-line interface to the WakaTime api
|
||||||
brew "wakatime-cli"
|
brew "wakatime-cli"
|
||||||
# Executes a program periodically, showing output fullscreen
|
# Executes a program periodically, showing output fullscreen
|
||||||
@@ -188,14 +215,14 @@ 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.
|
||||||
brew "ddosify/tap/ddosify"
|
brew "ddosify/tap/ddosify"
|
||||||
# lets you quickly switch between multiple git user profiles
|
# lets you quickly switch between multiple git user profiles
|
||||||
brew "gesquive/tap/git-user"
|
brew "gesquive/tap/git-user"
|
||||||
|
# A simple terminal UI for git commands, written in Go
|
||||||
|
brew "jesseduffield/lazygit/lazygit"
|
||||||
# High-performance, schema-free, document-oriented database
|
# High-performance, schema-free, document-oriented database
|
||||||
brew "mongodb/brew/mongodb-community"
|
brew "mongodb/brew/mongodb-community"
|
||||||
# Xdebug PHP extension
|
# Xdebug PHP extension
|
||||||
@@ -246,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
|
||||||
|
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ export NVM_DIR="$HOME/.nvm"
|
|||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
|
|
||||||
alias php="php -d error_reporting=22527"
|
alias php="php -d error_reporting=22527"
|
||||||
|
|
||||||
|
|||||||
153
base/zshrc
153
base/zshrc
@@ -1,3 +1,4 @@
|
|||||||
|
# this is my zsh config. there are many like it, but this one is mine.
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
autoload -U colors zsh/terminfo
|
autoload -U colors zsh/terminfo
|
||||||
@@ -6,159 +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@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
|
|
||||||
[ -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=$(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()
|
||||||
{
|
{
|
||||||
# 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)"
|
||||||
|
|
||||||
|
|||||||
52
config/alias
Normal file → Executable file
52
config/alias
Normal file → Executable file
@@ -1,5 +1,4 @@
|
|||||||
# shellcheck shell=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.
|
||||||
52
config/exports
Normal file → Executable file
52
config/exports
Normal file → Executable file
@@ -1,23 +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"
|
||||||
export HISTCONTROL=ignoredups
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
|
export XDG_STATE_HOME="$HOME/.local/state"
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
|
source "$DOTFILES/config/exports-shell"
|
||||||
|
source "$DOTFILES/config/exports-apps"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
51
config/functions
Normal file → Executable file
51
config/functions
Normal file → Executable file
@@ -1,4 +1,4 @@
|
|||||||
# shellcheck shell=bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# shell functions
|
# shell functions
|
||||||
#
|
#
|
||||||
@@ -65,3 +65,52 @@ 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
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
name = Ismo Vuorinen
|
name = Ismo Vuorinen
|
||||||
email = ismo@ivuorinen.net
|
email = ismo@ivuorinen.net
|
||||||
|
|
||||||
|
[credential]
|
||||||
|
helper = store --file ~/.cache/git/git-credentials
|
||||||
|
helper = cache --timeout 30000
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
excludesfile = ~/.config/git/gitignore
|
excludesfile = ~/.config/git/gitignore
|
||||||
|
|
||||||
|
|||||||
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: ca088647e2...8d142661f7
9
config/nvm/default-packages
Normal file
9
config/nvm/default-packages
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
blade-formatter
|
||||||
|
corepack
|
||||||
|
editorconfig-checker
|
||||||
|
github-release-notes
|
||||||
|
js-debug
|
||||||
|
neovim
|
||||||
|
prettier
|
||||||
|
standardjs
|
||||||
|
stylelint-lsp
|
||||||
@@ -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,7 +0,0 @@
|
|||||||
# ~/.bash_logout: executed by bash(1) when login shell exits.
|
|
||||||
|
|
||||||
# when leaving the console clear the screen to increase privacy
|
|
||||||
|
|
||||||
if [ "$SHLVL" = 1 ]; then
|
|
||||||
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
|
|
||||||
fi
|
|
||||||
@@ -1,117 +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
@@ -72,3 +72,4 @@
|
|||||||
|
|
||||||
[submodule]
|
[submodule]
|
||||||
recurse = true
|
recurse = true
|
||||||
|
|
||||||
|
|||||||
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,20 +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,119 +1,38 @@
|
|||||||
---
|
- include: 'hosts/defaults.yaml'
|
||||||
- defaults:
|
|
||||||
brewfile:
|
|
||||||
stderr: true
|
|
||||||
stdout: true
|
|
||||||
create:
|
|
||||||
mode: 755
|
|
||||||
link:
|
|
||||||
create: true
|
|
||||||
relink: true
|
|
||||||
|
|
||||||
- clean:
|
- clean:
|
||||||
~/:
|
~/:
|
||||||
~/.config:
|
~/.config:
|
||||||
recursive: true
|
recursive: true
|
||||||
~/.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: 700
|
mode: 0700
|
||||||
~/Code:
|
~/Code:
|
||||||
|
|
||||||
- link:
|
- link:
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
path: config/*
|
|
||||||
~/.local/bin/:
|
|
||||||
glob: true
|
|
||||||
path: local/bin/*
|
|
||||||
~/.ssh/:
|
|
||||||
force: true
|
|
||||||
glob: true
|
|
||||||
mode: 600
|
|
||||||
path: ssh/*
|
|
||||||
~/:
|
~/:
|
||||||
force: true
|
force: true
|
||||||
glob: true
|
glob: true
|
||||||
path: base/*
|
path: base/**
|
||||||
prefix: "."
|
prefix: "."
|
||||||
|
~/.config/:
|
||||||
|
glob: true
|
||||||
|
path: config/**
|
||||||
|
~/.local/bin/:
|
||||||
|
glob: true
|
||||||
|
path: local/bin/**
|
||||||
|
~/.ssh/:
|
||||||
|
force: true
|
||||||
|
glob: true
|
||||||
|
mode: 0600
|
||||||
|
path: ssh/**
|
||||||
- shell:
|
- shell:
|
||||||
- [git submodule update --init --recursive --force]
|
- git submodule update --init --recursive --force
|
||||||
- [bash scripts/install-npm-packages.sh]
|
- bash local/bin/dfm install all
|
||||||
|
|
||||||
- ifmacos:
|
|
||||||
- shell:
|
|
||||||
- [bash scripts/set-macos-defaults.sh]
|
|
||||||
- brewfile:
|
|
||||||
- Brewfile
|
|
||||||
|
|
||||||
# hosts: air
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = air ]]"
|
|
||||||
met:
|
|
||||||
- go:
|
|
||||||
- github.com/skx/sysbox@latest
|
|
||||||
|
|
||||||
# hosts: v
|
|
||||||
- if:
|
|
||||||
- cond: "[[ $(hostname) = v ]]"
|
|
||||||
met:
|
|
||||||
- link:
|
|
||||||
~/.config/:
|
|
||||||
glob: true
|
|
||||||
force: true
|
|
||||||
path: hosts/v/config/**
|
|
||||||
- go:
|
|
||||||
- github.com/skx/sysbox@latest
|
|
||||||
|
|
||||||
# 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
|
|
||||||
# GitHub CLI extension for reviewing Dependabot PRs.
|
|
||||||
- einride/gh-dependabot
|
|
||||||
# A GitHub CLI extension that provides summary pull request metrics.
|
|
||||||
- hectcastro/gh-metrics
|
|
||||||
# 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
|
|
||||||
- samcoe/gh-triage
|
|
||||||
# Generate account/organization/enterprise reports
|
|
||||||
- stoe/gh-report
|
|
||||||
# Organisation specific extension for gh cli
|
|
||||||
# to retrieve different statistics
|
|
||||||
- VildMedPap/gh-orgstats
|
|
||||||
- vilmibm/gh-screensaver
|
|
||||||
- vilmibm/gh-user-status
|
|
||||||
#
|
|
||||||
|
|||||||
117
local/bin/dfm
117
local/bin/dfm
@@ -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,38 +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 | 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 "npm" "Install NPM Packages"
|
|
||||||
menu_item "macos" "Setup nice macOS defaults"
|
menu_item "macos" "Setup nice macOS defaults"
|
||||||
menu_item "settler" "Runs the WIP settler.sh"
|
menu_item "nvm" "Install Node Version Manager (nvm)"
|
||||||
|
menu_item "npm" "Install NPM Packages"
|
||||||
|
menu_item "ntfy" "Install ntfy"
|
||||||
|
menu_item "z" "Install z"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -102,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
|
||||||
@@ -117,21 +174,37 @@ function section_dotfiles
|
|||||||
ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim
|
ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim
|
||||||
ln -s ~/.dotfiles/config/nvim ~/.config/nvim
|
ln -s ~/.dotfiles/config/nvim ~/.config/nvim
|
||||||
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)
|
||||||
|
# format yaml files
|
||||||
|
yamlfmt -conf "$DOTFILES/.yamlfmt"
|
||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# Format shell scripts according to following rules.
|
# Format shell scripts according to following rules.
|
||||||
find "$DOTFILES" \
|
find "$DOTFILES" \
|
||||||
\( -name '*.sh' -or -name '*.zsh' -or -name 'x-*' -or -not '*.pl' \) \
|
-type f -perm +111 \
|
||||||
-exec shfmt -fn -l -w -i 2 -ci -sr -bn {} \;
|
-not -path '*/.git/*' \
|
||||||
msg_done "🎉 dotfiles have been formatted!"
|
-not -path '*dotbot*' \
|
||||||
|
-not -name '*.pl' \
|
||||||
|
-not -name '*.py' \
|
||||||
|
-not -name '*.php' \
|
||||||
|
-not -name '*.zsh' \
|
||||||
|
-exec shfmt \
|
||||||
|
--language-dialect bash \
|
||||||
|
--func-next-line --list --write \
|
||||||
|
--indent 2 --case-indent --space-redirects \
|
||||||
|
--binary-next-line {} \;
|
||||||
|
msg_done "🎉 dotfiles have been shfmt formatted!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
menu_section "$USAGE_PREFIX" "reset_all | reset_nvim | 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 "shfmt" "Run shfmt to all dotfiles"
|
menu_item "shfmt" "Run shfmt to all dotfiles"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -144,11 +217,11 @@ function section_check
|
|||||||
X_ARCH=$(uname)
|
X_ARCH=$(uname)
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
a|arch)
|
a | arch)
|
||||||
[[ "$2" = "" ]] && echo "$X_ARCH" && exit 0
|
[[ "$2" = "" ]] && echo "$X_ARCH" && exit 0
|
||||||
[[ $X_ARCH = "$2" ]] && exit 0 || exit 1
|
[[ $X_ARCH = "$2" ]] && exit 0 || exit 1
|
||||||
;;
|
;;
|
||||||
h|host|hostname)
|
h | host | hostname)
|
||||||
[[ "$2" = "" ]] && echo "$X_HOSTNAME" && exit 0
|
[[ "$2" = "" ]] && echo "$X_HOSTNAME" && exit 0
|
||||||
[[ $X_HOSTNAME = "$2" ]] && exit 0 || exit 1
|
[[ $X_HOSTNAME = "$2" ]] && exit 0 || exit 1
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ if [[ -o interactive ]]; then
|
|||||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||||
# Indicates start of command output. Runs just before command executes.
|
# Indicates start of command output. Runs just before command executes.
|
||||||
iterm2_before_cmd_executes() {
|
iterm2_before_cmd_executes()
|
||||||
|
{
|
||||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
||||||
printf "\033]133;C;\r\007"
|
printf "\033]133;C;\r\007"
|
||||||
else
|
else
|
||||||
@@ -25,7 +26,8 @@ if [[ -o interactive ]]; then
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
iterm2_set_user_var() {
|
iterm2_set_user_var()
|
||||||
|
{
|
||||||
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,15 +38,17 @@ if [[ -o interactive ]]; then
|
|||||||
# \(user.currentDirectory).
|
# \(user.currentDirectory).
|
||||||
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
iterm2_print_user_vars() {
|
iterm2_print_user_vars()
|
||||||
true
|
{
|
||||||
|
true
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iterm2_print_state_data() {
|
iterm2_print_state_data()
|
||||||
|
{
|
||||||
local _iterm2_hostname="${iterm2_hostname-}"
|
local _iterm2_hostname="${iterm2_hostname-}"
|
||||||
if [ -z "${iterm2_hostname:-}" ]; then
|
if [ -z "${iterm2_hostname:-}" ]; then
|
||||||
_iterm2_hostname=$(hostname -f 2>/dev/null)
|
_iterm2_hostname=$(hostname -f 2> /dev/null)
|
||||||
fi
|
fi
|
||||||
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
||||||
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
||||||
@@ -52,18 +56,21 @@ if [[ -o interactive ]]; then
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Report return code of command; runs after command finishes but before prompt
|
# Report return code of command; runs after command finishes but before prompt
|
||||||
iterm2_after_cmd_executes() {
|
iterm2_after_cmd_executes()
|
||||||
|
{
|
||||||
printf "\033]133;D;%s\007" "$STATUS"
|
printf "\033]133;D;%s\007" "$STATUS"
|
||||||
iterm2_print_state_data
|
iterm2_print_state_data
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mark start of prompt
|
# Mark start of prompt
|
||||||
iterm2_prompt_mark() {
|
iterm2_prompt_mark()
|
||||||
|
{
|
||||||
printf "\033]133;A\007"
|
printf "\033]133;A\007"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mark end of prompt
|
# Mark end of prompt
|
||||||
iterm2_prompt_end() {
|
iterm2_prompt_end()
|
||||||
|
{
|
||||||
printf "\033]133;B\007"
|
printf "\033]133;B\007"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +112,8 @@ if [[ -o interactive ]]; then
|
|||||||
# * PS1 does not have our escape sequences during command execution
|
# * PS1 does not have our escape sequences during command execution
|
||||||
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
||||||
# ITERM2_PRECMD_PS1 has PS1's original value.
|
# ITERM2_PRECMD_PS1 has PS1's original value.
|
||||||
iterm2_decorate_prompt() {
|
iterm2_decorate_prompt()
|
||||||
|
{
|
||||||
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
||||||
# execution.
|
# execution.
|
||||||
ITERM2_PRECMD_PS1="$PS1"
|
ITERM2_PRECMD_PS1="$PS1"
|
||||||
@@ -126,7 +134,8 @@ if [[ -o interactive ]]; then
|
|||||||
ITERM2_DECORATED_PS1="$PS1"
|
ITERM2_DECORATED_PS1="$PS1"
|
||||||
}
|
}
|
||||||
|
|
||||||
iterm2_precmd() {
|
iterm2_precmd()
|
||||||
|
{
|
||||||
local STATUS="$?"
|
local STATUS="$?"
|
||||||
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
||||||
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
||||||
@@ -145,7 +154,8 @@ if [[ -o interactive ]]; then
|
|||||||
}
|
}
|
||||||
|
|
||||||
# This is not run if you press ^C while entering a command.
|
# This is not run if you press ^C while entering a command.
|
||||||
iterm2_preexec() {
|
iterm2_preexec()
|
||||||
|
{
|
||||||
# Set PS1 back to its raw value prior to executing the command.
|
# Set PS1 back to its raw value prior to executing the command.
|
||||||
PS1="$ITERM2_PRECMD_PS1"
|
PS1="$ITERM2_PRECMD_PS1"
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||||
@@ -158,10 +168,10 @@ if [[ -o interactive ]]; then
|
|||||||
# to a VPN.
|
# to a VPN.
|
||||||
if [ -z "${iterm2_hostname-}" ]; then
|
if [ -z "${iterm2_hostname-}" ]; then
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
iterm2_hostname=`hostname -f 2>/dev/null`
|
iterm2_hostname=$(hostname -f 2> /dev/null)
|
||||||
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
iterm2_hostname=`hostname`
|
iterm2_hostname=$(hostname)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ if [ -z "${DIRECTORY}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${FILENAME}" ]; then
|
if [ -z "${FILENAME}" ]; then
|
||||||
FILENAME=$DIRECTORY
|
FILENAME=$DIRECTORY
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILENAME=${FILENAME} | \
|
FILENAME=${FILENAME} \
|
||||||
tr '/' _ | \
|
| tr '/' _ \
|
||||||
iconv -t ascii//TRANSLIT | \
|
| iconv -t ascii//TRANSLIT \
|
||||||
sed -r s/[^a-zA-Z0-9]+/_/g | \
|
| sed -r s/[^a-zA-Z0-9]+/_/g \
|
||||||
sed -r s/^_+\|-+$//g
|
| sed -r s/^_+\|-+$//g
|
||||||
|
|
||||||
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
||||||
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
FILENAME_TIMESTAMP="${FILENAME}_${TIMESTAMP}"
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ TIMESTAMP=$(date "+%Y%m%d_%H%M%S")
|
|||||||
FILENAME_TIMESTAMP="${DATABASE}_${FILENAME}_${TIMESTAMP}.sql"
|
FILENAME_TIMESTAMP="${DATABASE}_${FILENAME}_${TIMESTAMP}.sql"
|
||||||
|
|
||||||
mysqldump \
|
mysqldump \
|
||||||
${DATABASE} \
|
"${DATABASE}" \
|
||||||
"$(
|
"$(
|
||||||
echo "show tables like '${PREFIX}%';" \
|
echo "show tables like '${PREFIX}%';" \
|
||||||
| mysql ${DATABASE} \
|
| mysql "${DATABASE}" \
|
||||||
| sed '/Tables_in/d'
|
| sed '/Tables_in/d'
|
||||||
)" > "${FILENAME_TIMESTAMP}"
|
)" > "${FILENAME_TIMESTAMP}"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
if ! command -v git &> /dev/null; then
|
if ! command -v git &> /dev/null; then
|
||||||
echo "git could not be found, please install it first"
|
echo "git could not be found, please install it first"
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
missing_attributes=$(git ls-files | git check-attr -a --stdin | grep "text: auto")
|
missing_attributes=$(git ls-files | git check-attr -a --stdin | grep "text: auto")
|
||||||
|
|||||||
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
|
||||||
|
|
||||||
@@ -206,3 +206,4 @@ sub parsedOptions
|
|||||||
return (%vars);
|
return (%vars);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
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 "${@}"
|
||||||
|
|
||||||
@@ -226,3 +226,4 @@ sub parsedOptions
|
|||||||
return (%vars);
|
return (%vars);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# List open (listened) ports, without the crud that
|
# List open (listened) ports, without the crud that
|
||||||
# usually comes with `lsof -i`
|
# usually comes with `lsof -i`
|
||||||
#
|
#
|
||||||
|
# Modified by: Ismo Vuorinen <https://github.com/ivuorinen> 2020
|
||||||
# Originally from: https://www.commandlinefu.com/commands/view/8951
|
# Originally from: https://www.commandlinefu.com/commands/view/8951
|
||||||
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
|
# Original author: https://www.commandlinefu.com/commands/by/wickedcpj
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -4,37 +4,27 @@
|
|||||||
# -----
|
# -----
|
||||||
# Check the expiry date of the SSL certificate on the given host.
|
# Check the expiry date of the SSL certificate on the given host.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# License
|
# License
|
||||||
# -------
|
# -------
|
||||||
#
|
|
||||||
# Copyright (c) 2013-2015 by Steve Kemp. All rights reserved.
|
# Copyright (c) 2013-2015 by Steve Kemp. All rights reserved.
|
||||||
#
|
#
|
||||||
# This script is free software; you can redistribute it and/or modify it under
|
# This script is free software; you can redistribute it and/or modify it under
|
||||||
# the same terms as Perl itself.
|
# the same terms as Perl itself.
|
||||||
#
|
#
|
||||||
# The LICENSE file contains the full text of the license.
|
# The LICENSE file contains the full text of the license.
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
# Simple function to show usage information, and exit.
|
||||||
# Simple function to show usage information, and exit.
|
|
||||||
#
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
echo "Usage: $0 [-d] [-p 443] domain1.org domain2.com .. domainN"
|
echo "Usage: $0 [-d] [-p 443] domain1.org domain2.com .. domainN"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
# Default settings for flags set by the command-line arguments
|
||||||
# Default settings for flags set by the command-line arguments
|
|
||||||
#
|
|
||||||
days=0
|
days=0
|
||||||
port=443
|
port=443
|
||||||
|
|
||||||
#
|
# Parse the argument(s) - i.e. look for "-d" / "-p 443".
|
||||||
# Parse the argument(s) - i.e. look for "-d" / "-p 443".
|
|
||||||
#
|
|
||||||
while getopts "h?dp:" opt; do
|
while getopts "h?dp:" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
h)
|
h)
|
||||||
@@ -53,21 +43,15 @@ while getopts "h?dp:" opt; do
|
|||||||
done
|
done
|
||||||
shift $((OPTIND - 1))
|
shift $((OPTIND - 1))
|
||||||
|
|
||||||
#
|
# Ensure we have some arguments
|
||||||
# Ensure we have some arguments
|
|
||||||
#
|
|
||||||
if [ "$#" = "0" ]; then
|
if [ "$#" = "0" ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# For each domain-name on the command-line.
|
# For each domain-name on the command-line.
|
||||||
#
|
|
||||||
for name in "$@"; do
|
for name in "$@"; do
|
||||||
|
|
||||||
#
|
# Make a temporary file
|
||||||
# Make a temporary file
|
|
||||||
#
|
|
||||||
# Test if we have BSD or GNU version of mktemp
|
# Test if we have BSD or GNU version of mktemp
|
||||||
if (strings "$(which mktemp)" | grep -q GNU); then
|
if (strings "$(which mktemp)" | grep -q GNU); then
|
||||||
# We have the GNU version
|
# We have the GNU version
|
||||||
@@ -77,27 +61,19 @@ for name in "$@"; do
|
|||||||
tmp=$(mktemp -t tmp)
|
tmp=$(mktemp -t tmp)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
# Download the certificate
|
||||||
# Download the certificate
|
if (! echo "" | openssl s_client -connect "$name:$port" > "$tmp" 2> /dev/null); then
|
||||||
#
|
|
||||||
if (! echo "" | openssl s_client -connect $name:$port > $tmp 2> /dev/null); then
|
|
||||||
echo "Failed to get cert from https://$name:$port/"
|
echo "Failed to get cert from https://$name:$port/"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
# Get the expiry date
|
||||||
# Get the expiry date
|
|
||||||
#
|
|
||||||
date=$(openssl x509 -in "$tmp" -noout -enddate | awk -F= '{print $2}')
|
date=$(openssl x509 -in "$tmp" -noout -enddate | awk -F= '{print $2}')
|
||||||
|
|
||||||
#
|
# Remove the temporary file
|
||||||
# Remove the temporary file
|
|
||||||
#
|
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
|
|
||||||
#
|
# Convert the expiry date + todays date to seconds-past epoch
|
||||||
# Convert the expiry date + todays date to seconds-past epoch
|
|
||||||
#
|
|
||||||
# Check if we have the BSD or the GNU version of date
|
# Check if we have the BSD or the GNU version of date
|
||||||
if (strings "$(which date)" | grep -q GNU); then
|
if (strings "$(which date)" | grep -q GNU); then
|
||||||
# We have GNU this is easy
|
# We have GNU this is easy
|
||||||
@@ -115,15 +91,11 @@ for name in "$@"; do
|
|||||||
|
|
||||||
now=$(date +%s)
|
now=$(date +%s)
|
||||||
|
|
||||||
#
|
# Day diff
|
||||||
# Day diff
|
|
||||||
#
|
|
||||||
diff=$(("$then" - "$now"))
|
diff=$(("$then" - "$now"))
|
||||||
diff=$($diff / 86400)
|
diff=$($diff / 86400)
|
||||||
|
|
||||||
#
|
# All done
|
||||||
# All done
|
|
||||||
#
|
|
||||||
if [ "$days" = "1" ]; then
|
if [ "$days" = "1" ]; then
|
||||||
echo "${name}: ${diff}"
|
echo "${name}: ${diff}"
|
||||||
else
|
else
|
||||||
|
|||||||
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
|
||||||
@@ -3,13 +3,10 @@
|
|||||||
# About
|
# About
|
||||||
# -----
|
# -----
|
||||||
# Repeat the command until it fails - always run at least once.
|
# Repeat the command until it fails - always run at least once.
|
||||||
#
|
|
||||||
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
#
|
# If the status code was zero then repeat.
|
||||||
# If the status code was zero then repeat.
|
|
||||||
#
|
|
||||||
while [ $? -eq 0 ]; do
|
while [ $? -eq 0 ]; do
|
||||||
"$@"
|
"$@"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -14,17 +14,11 @@
|
|||||||
# the same terms as Perl itself.
|
# the same terms as Perl itself.
|
||||||
#
|
#
|
||||||
# The LICENSE file contains the full text of the license.
|
# The LICENSE file contains the full text of the license.
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
# Run the first time.
|
||||||
# Run the first time.
|
|
||||||
#
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
#
|
# If the status code was not zero then repeat.
|
||||||
# If the status code was not zero then repeat.
|
|
||||||
#
|
|
||||||
while [ $? -ne 0 ]; do
|
while [ $? -ne 0 ]; do
|
||||||
"$@"
|
"$@"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ echo "Waiting for $HOST to get down..."
|
|||||||
|
|
||||||
true
|
true
|
||||||
while [ $? -ne 1 ]; do
|
while [ $? -ne 1 ]; do
|
||||||
ping -c 1 -W 1 $HOST > /dev/null
|
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if [ $# -lt 2 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $1 = "ssh" ]; then
|
if [ "$1" = "ssh" ]; then
|
||||||
HOST=$2
|
HOST=$2
|
||||||
else
|
else
|
||||||
HOST=$1
|
HOST=$1
|
||||||
@@ -30,15 +30,15 @@ fi
|
|||||||
|
|
||||||
echo "Waiting for $HOST to come online..."
|
echo "Waiting for $HOST to come online..."
|
||||||
|
|
||||||
ping -c 1 -W 1 $HOST > /dev/null
|
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||||
while [ $? -ne 0 ]; do
|
while [ $? -ne 0 ]; do
|
||||||
sleep 1
|
sleep 1
|
||||||
ping -c 1 -W 1 $HOST > /dev/null
|
ping -c 1 -W 1 "$HOST" > /dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
# By the time we reach here the ping-command has completed successfully
|
# By the time we reach here the ping-command has completed successfully
|
||||||
# so we can launch the command we were given - along with any arguments.
|
# so we can launch the command we were given - along with any arguments.
|
||||||
if [ $1 != "ssh" ]; then
|
if [ "$1" != "ssh" ]; then
|
||||||
shift
|
shift
|
||||||
fi
|
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
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
# - https://github.com/freekmurze/dotfiles/blob/main/macos/set-defaults.sh
|
# - https://github.com/freekmurze/dotfiles/blob/main/macos/set-defaults.sh
|
||||||
#
|
#
|
||||||
|
|
||||||
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0;
|
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
|
||||||
|
|
||||||
# Ask for the administrator password upfront
|
# Ask for the administrator password upfront
|
||||||
sudo -v
|
sudo -v
|
||||||
@@ -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 #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
# -- Colors -- #
|
# -- Colors -- #
|
||||||
CLR_RED="\033[1;31m"
|
CLR_RED="\033[1;31m"
|
||||||
CLR_YELLOW='\033[1;33m'
|
CLR_YELLOW="\033[1;33m"
|
||||||
CLR_GREEN="\033[1;32m"
|
CLR_GREEN="\033[1;32m"
|
||||||
CLR_BLUE='\033[1;34m'
|
CLR_BLUE="\033[1;34m"
|
||||||
CLR_RESET="\033[0m"
|
CLR_RESET="\033[0m"
|
||||||
|
|
||||||
# -- Helpers -- #
|
# -- Helpers -- #
|
||||||
|
|||||||
Reference in New Issue
Block a user