Compare commits

...

6 Commits

34 changed files with 115 additions and 105 deletions

58
.github/README.md vendored
View File

@@ -8,6 +8,9 @@ this repository will live accordingly.
Please for the love of everything good do not use these 1:1 as your own dotfiles,
fork or download the repo as a zip and go from there with your own configs.
It would be nice if you'd add an issue linking to your fork or repo so I can
see what interesing stuff you've done with it. Sharing is caring.
## Setup
### First time setup
@@ -35,7 +38,7 @@ fork or download the repo as a zip and go from there with your own configs.
| Path | Description |
| ------------------- | -------------------------------------------- |
| `.github` | GitHub Repository configuration files. |
| `.github` | GitHub Repository configuration files, meta. |
| `hosts/{hostname}/` | Configs that should apply to that host only. |
| `local/bin` | Helper scripts that I've collected or wrote. |
| `scripts` | Setup scripts. |
@@ -51,7 +54,9 @@ fork or download the repo as a zip and go from there with your own configs.
### dfm - the dotfiles manager
`.local/bin/dfm` is a shell script that has some tools that help with dotfiles management.
[`.local/bin/dfm`][dfm] is a shell script that has some tools that help with dotfiles management.
Running `dfm` gives you a list of available commands.
## Configuration
@@ -66,51 +71,8 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
| `$XDG_STATE_HOME` | `$HOME/.local/state` | App state that should persist between restarts |
#### XDG_BIN_HOME (`$HOME/.local/bin`)
`$XDG_BIN_HOME` defines directory that contains local binaries.
User-specific executable files may be stored in `$HOME/.local/bin`.
Distributions should ensure this directory shows up in the UNIX `$PATH`
environment variable, at an appropriate place.
#### XDG_DATA_HOME (`$HOME/.local/share`)
`$XDG_DATA_HOME` defines the base directory relative to which
user-specific _data files_ should be stored.
If `$XDG_DATA_HOME` is either not set or empty,
a default equal to `$HOME/.local/share` should be used.
#### XDG_CONFIG_HOME (`$HOME/.config`)
`$XDG_CONFIG_HOME` defines the base directory relative to which
user-specific _configuration files_ should be stored.
If `$XDG_CONFIG_HOME` is either not set or empty,
a default equal to `$HOME/.config` should be used.
#### XDG_STATE_HOME (`$HOME/.local/state`)
`$XDG_STATE_HOME` defines the base directory relative to which
user-specific _state files_ should be stored.
If `$XDG_STATE_HOME` is either not set or empty,
a default equal to `$HOME/.local/state` should be used.
The `$XDG_STATE_HOME` contains _state data_ that should
_persist between (application) restarts_, but that is not important or
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
- It may contain:
- actions history (logs, history, recently used files, …)
- current state of the application that can be reused
on a restart (view, layout, open files, undo history, …)
#### XDG_DATA_DIRS
`$XDG_DATA_DIRS` defines the preference-ordered set of base directories
to search for data files in addition to the `$XDG_DATA_HOME` base directory.
The directories in `$XDG_DATA_DIRS` should be separated with a colon ':'.
Please see [docs/folders.md][docs-folders] for more information.
[dfm]: https://github.com/ivuorinen/dotfiles/blob/main/local/bin/dfm
[docs-folders]: https://github.com/ivuorinen/dotfiles/blob/main/docs/folders.md
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

View File

@@ -1,7 +1,7 @@
# this is my bashrc config. there are many like it, but this one is mine.
# shellcheck shell=bash
source "$HOME/.dotfiles/config/shared"
source "$HOME/.dotfiles/config/shared.sh"
x-load-configs

View File

@@ -16,4 +16,4 @@ export XDG_BIN_HOME="$HOME/.local/bin"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_RUNTIME_DIR="$HOME/.local/run"
source "$DOTFILES/config/shared"
eval "$DOTFILES/config/shared.sh"

View File

@@ -1,12 +1,11 @@
# this is my zsh config. there are many like it, but this one is mine.
# shellcheck shell=bash
source "$HOME/.dotfiles/config/shared"
eval "$HOME/.dotfiles/config/shared.sh"
x-load-configs
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/bob/nvim-bin:$XDG_DATA_HOME/cargo/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
x-load-configs
x-have oh-my-posh && {
eval "$(oh-my-posh init zsh --config "$DOTFILES/config/omp/own.toml")"
}
@@ -38,9 +37,6 @@ export ZSH_TMUX_UNICODE=true
export ZSH_TMUX_AUTOQUIT=false
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# z, the zsh version
export ZSHZ_DATA="$XDG_STATE_HOME/z"
antigen bundle z
@@ -54,10 +50,6 @@ antigen bundle zsh-users/zsh-completions
x-have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
# nvm is a strange beast
zstyle ':omz:plugins:nvm' autoload yes
antigen bundle nvm
# this needs to be the last item
antigen bundle zsh-users/zsh-syntax-highlighting
antigen apply
@@ -90,8 +82,6 @@ x-have antidot && {
eval "$(antidot init)"
}
source "$DOTFILES/config/alias"
# Herd checks for a few environment variables to inject PHP binaries and configurations.
# Herd injected PHP binary.
# export PATH="/Users/ivuorinen/Library/Application\ Support/Herd/bin/":$PATH

View File

@@ -139,7 +139,7 @@ weather()
}
# Docker
ssh-docker()
ssh_docker()
{
docker exec -it "$@" bash
}

View File

@@ -0,0 +1,21 @@
// A cargo subcommand for checking and applying
// updates to installed executables
cargo-update
// Cargo cache management utility
cargo-cache
// An incremental parsing system for programming tools
tree-sitter-cli
// a subprocess caching utility
bkt
// a structural diff that understands syntax
difftastic
// A simple, fast and user-friendly alternative to 'find'
fd-find
// recursively searches directories for a
// regex pattern while respecting your gitignore
ripgrep
// A version manager for neovim
bob-nvim
// bottom, btm - A cross-platform graphical process/system monitor with
// a customizable interface and a multitude of features.
bottom

View File

@@ -15,6 +15,7 @@ nodejs https://github.com/asdf-vm/asdf-nodejs.git
pipx https://github.com/yozachar/asdf-pipx.git 31db618
pre-commit https://github.com/jonathanmorley/asdf-pre-commit.git 26bfc42
ripgrep https://gitlab.com/wt0f/asdf-ripgrep.git e836665
rust https://github.com/code-lever/asdf-rust.git 95acf4f
semgrep https://github.com/brentjanderson/asdf-semgrep.git 13ff78b
shellcheck https://github.com/luizm/asdf-shellcheck.git 780d78d
shfmt https://github.com/luizm/asdf-shfmt.git a42c5ff

View File

@@ -16,6 +16,7 @@ nodejs 22.4.1
pipx 1.6.0
pre-commit 3.7.1
ripgrep 14.1.0
rust 1.79.0
semgrep system
shellcheck 0.10.0
shfmt 3.8.0

View File

@@ -37,7 +37,7 @@ have()
# function to run dark-notify and change alacritty theme
# it uses flock to prevent running multiple instances
# install flock with `brew install flock` on macOS
function darknotify-alacritty
function darknotify_alacritty
{
have flock && [[ -f /tmp/dark-notify-alacritty.lock ]] && return
have dark-notify && {
@@ -48,7 +48,7 @@ function darknotify-alacritty
return 0
}
darknotify-alacritty
darknotify_alacritty
brew_installed()
{

View File

@@ -34,6 +34,7 @@ export ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY="latest_available"
export ASDF_NPM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/npm-packages"
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
export ASDF_GOLANG_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/golang-packages"
export ASDF_CRATE_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME}/asdf/cargo-packages"
export PATH="${ASDF_DIR}/bin:${PATH}"
# bob manages nvim versions

1
config/shared → config/shared.sh Normal file → Executable file
View File

@@ -21,4 +21,3 @@ export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOM
source "$DOTFILES/config/exports"
source "$DOTFILES/config/functions"
source "$DOTFILES/config/alias"

53
docs/folders.md Normal file
View File

@@ -0,0 +1,53 @@
# Interesting folders
## XDG
XDG is a set of specifications that provide a standard for the organization
of user-specific files and directories. It is based on the _XDG Base Directory Specification_.
### XDG_BIN_HOME (`$HOME/.local/bin`)
`$XDG_BIN_HOME` defines directory that contains local binaries.
User-specific executable files may be stored in `$HOME/.local/bin`.
Distributions should ensure this directory shows up in the UNIX `$PATH`
environment variable, at an appropriate place.
### XDG_DATA_HOME (`$HOME/.local/share`)
`$XDG_DATA_HOME` defines the base directory relative to which
user-specific _data files_ should be stored.
If `$XDG_DATA_HOME` is either not set or empty,
a default equal to `$HOME/.local/share` should be used.
### XDG_CONFIG_HOME (`$HOME/.config`)
`$XDG_CONFIG_HOME` defines the base directory relative to which
user-specific _configuration files_ should be stored.
If `$XDG_CONFIG_HOME` is either not set or empty,
a default equal to `$HOME/.config` should be used.
### XDG_STATE_HOME (`$HOME/.local/state`)
`$XDG_STATE_HOME` defines the base directory relative to which
user-specific _state files_ should be stored.
If `$XDG_STATE_HOME` is either not set or empty,
a default equal to `$HOME/.local/state` should be used.
The `$XDG_STATE_HOME` contains _state data_ that should
_persist between (application) restarts_, but that is not important or
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
- It may contain:
- actions history (logs, history, recently used files, …)
- current state of the application that can be reused
on a restart (view, layout, open files, undo history, …)
### XDG_DATA_DIRS
`$XDG_DATA_DIRS` defines the preference-ordered set of base directories
to search for data files in addition to the `$XDG_DATA_HOME` base directory.
The directories in `$XDG_DATA_DIRS` should be separated with a colon ':'.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -65,7 +65,7 @@ function section_install
$0 install asdf
# $0 install ohmybash
# $0 install pip
$0 install cargo
# $0 install cargo
$0 install composer
# $0 install dotenv
$0 install fzf

View File

@@ -2,10 +2,7 @@
# Create file containing key mappings for Neovim
# Usage: ./create-nvim-keymaps.sh
source "$HOME/.dotfiles/scripts/shared.sh"
source "$HOME/.dotfiles/config/exports"
source "$HOME/.dotfiles/config/alias"
source "$HOME/.dotfiles/config/functions"
eval "$HOME/.dotfiles/scripts/shared.sh"
DEST="$HOME/.dotfiles/docs/nvim-keybindings.md"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
set -e
cd "$DOTFILES" || exit

View File

@@ -2,7 +2,7 @@
#
# Install asdf
source "${XDG_CONFIG_HOME}/shared"
source "${XDG_CONFIG_HOME}/shared.sh"
source "${DOTFILES}/scripts/shared.sh"
export ASDF_DIR="${XDG_BIN_HOME}/asdf"

View File

@@ -2,27 +2,12 @@
# Install cargo/rust packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/config/exports"
source "$HOME/.dotfiles/config/alias"
source "$HOME/.dotfiles/config/functions"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install rust/cargo packages"
! x-have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y
}
source "$CARGO_HOME/env"
! x-have rustup && {
msg_err "rustup could not be found. Aborting..."
exit 1
}
rustup default stable
# If we have cargo install-update, use it first
x-have cargo-install-update && {
msg_run "Updating cargo packages with cargo install-update"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# shellcheck disable=SC2231,SC2034,SC2181,SC2068
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(git cheat)
for t in ${PBB_REQUIRED_TOOLS[@]}; do

View File

@@ -2,7 +2,7 @@
# Install PHP Package Manager Composer
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
! x-have "php" && msg_err "PHP Not Available, cannot install composer" && exit 0

View File

@@ -2,7 +2,7 @@
# Install NerdFonts
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
GIT_REPO="https://github.com/ryanoasis/nerd-fonts.git"
TMP_PATH="$XDG_CACHE_HOME/nerd-fonts"

View File

@@ -3,7 +3,7 @@
# Install fzf
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
FZF_GIT="https://github.com/junegunn/fzf.git"
FZF_PATH="${XDG_CONFIG_HOME}/fzf"

View File

@@ -2,7 +2,7 @@
# Install GitHub CLI extensions
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing gh (GitHub Client) extensions"

View File

@@ -4,7 +4,7 @@
# NOTE: Experimental, wip
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing git-crypt"

View File

@@ -2,7 +2,7 @@
# Install Go packages
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing go packages"

View File

@@ -3,7 +3,7 @@
# Install neofetch from source
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
NEOFETCH_VERSION="7.1.0"
NEOFETCH_REPO="https://github.com/dylanaraps/neofetch"

View File

@@ -2,7 +2,7 @@
# Install npm packages globally.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install npm packages"

View File

@@ -3,7 +3,7 @@
# Install ntfy
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
set -e
x-have "ntfy" && msg "ntfy already installed" && exit 0

View File

@@ -3,7 +3,7 @@
# Install oh-my-bash
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
export OSH="$HOME/.local/share/oh-my-bash"

View File

@@ -3,7 +3,7 @@
# Install oh-my-posh
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/.local/bin

View File

@@ -2,7 +2,7 @@
# Install python/pip packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install pip packages"

View File

@@ -3,7 +3,7 @@
# Install z
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
Z_GIT_PATH="https://github.com/rupa/z.git"
Z_BIN_PATH="$XDG_BIN_HOME/z"

View File

@@ -9,7 +9,7 @@
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
eval "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Starting to set macOS defaults, these require sudo privileges:"

View File

@@ -12,7 +12,7 @@
|| [[ -n $BASH_VERSION ]] && (return 0 2> /dev/null)
) && sourced=1 || sourced=0
source "$HOME/.dotfiles/config/shared"
eval "$HOME/.dotfiles/config/shared.sh"
DOTFILES_CURRENT_SHELL=$(ps -p $$ -oargs=)
export DOTFILES_CURRENT_SHELL