mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-26 17:19:26 +00:00
Compare commits
9 Commits
e46d6b0dd3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
0fbde15f3e
|
|||
|
60a620ef3d
|
|||
|
06c1038d3c
|
|||
|
f3f26438cb
|
|||
|
6ce4a4b927
|
|||
|
e6e1c51a96
|
|||
|
78646a7e1d
|
|||
|
ce04253da0
|
|||
|
f61ffaa4ff
|
@@ -1,2 +1,3 @@
|
||||
# shellcheck shell=bash
|
||||
# ~/.bash_logout
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# Get the aliases and functions
|
||||
if [ -f $HOME/.bashrc ]; then
|
||||
source $HOME/.bashrc
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# .bashrc
|
||||
|
||||
# Source global definitions
|
||||
|
||||
@@ -1,53 +1,65 @@
|
||||
cask_args appdir: "~/Applications"
|
||||
|
||||
tap "dart-lang/dart"
|
||||
tap "fluxcd/tap"
|
||||
tap "go-task/tap"
|
||||
tap "homebrew/bundle"
|
||||
tap "localstack/tap"
|
||||
tap "sass/sass"
|
||||
|
||||
brew "awscli"
|
||||
brew "awslogs"
|
||||
brew "dockutil"
|
||||
brew "fluxcd/tap/flux"
|
||||
brew "go"
|
||||
brew "fzf"
|
||||
brew "go-task/tap/go-task"
|
||||
brew "hugo"
|
||||
brew "k9s"
|
||||
brew "kubectl-cnpg"
|
||||
brew "kubeseal"
|
||||
brew "kubernetes-cli"
|
||||
brew "mas"
|
||||
brew "poetry"
|
||||
brew "sass/sass/sass"
|
||||
brew "smartmontools"
|
||||
brew "go"
|
||||
brew "hashicorp/tap/terraform"
|
||||
brew "helm"
|
||||
brew "hugo"
|
||||
brew "jq"
|
||||
brew "kubectl-cnpg"
|
||||
brew "kubelogin"
|
||||
brew "kubernetes-cli"
|
||||
brew "kubeseal"
|
||||
brew "localstack-cli"
|
||||
brew "mas"
|
||||
brew "packer"
|
||||
brew "poetry"
|
||||
brew "python@3.14"
|
||||
brew "sass/sass/sass"
|
||||
brew "shellcheck"
|
||||
brew "smartmontools"
|
||||
brew "terraform-docs"
|
||||
brew "terraform-local"
|
||||
brew "tflint"
|
||||
brew "tz"
|
||||
brew "uv"
|
||||
brew "yazi"
|
||||
brew "jq"
|
||||
brew "fzf"
|
||||
|
||||
cask "appcleaner"
|
||||
cask "balenaetcher"
|
||||
cask "caldigit-docking-utility"
|
||||
cask "caldigit-thunderbolt-charging"
|
||||
cask "clop"
|
||||
cask "coconutbattery"
|
||||
cask "daisydisk"
|
||||
cask "ghostty"
|
||||
cask "itsycal"
|
||||
cask "knockknock"
|
||||
cask "lens"
|
||||
cask "logi-options+"
|
||||
cask "logseq"
|
||||
cask "lunar"
|
||||
cask "orbstack"
|
||||
cask "qmk-toolbox"
|
||||
cask "rectangle"
|
||||
cask "vial"
|
||||
cask "viscosity"
|
||||
cask "visual-studio-code"
|
||||
cask "vlc"
|
||||
cask "wireshark"
|
||||
cask "wireshark-app"
|
||||
|
||||
cask "font-iosevka"
|
||||
cask "font-input"
|
||||
cask "font-inter"
|
||||
cask "font-iosevka"
|
||||
cask "font-jetbrains-mono"
|
||||
|
||||
mas "AmorphousDiskMark", id: 1168254295
|
||||
@@ -58,10 +70,12 @@ mas "Flighty – Live Flight Tracker", id: 1358823008
|
||||
mas "Hand Mirror", id: 1502839586
|
||||
mas "Hidden Bar", id: 1452453066
|
||||
mas "Home Assistant", id: 1099568401
|
||||
mas "Hush", id: 1544743900
|
||||
mas "Hush Nag Blocker", id: 1544743900
|
||||
mas "Hush", id: 1544743900
|
||||
mas "Ivory", id: 6444602274
|
||||
mas "MQTT Explorer", id: 1455214828
|
||||
mas "OTP Auth", id: 1471867429
|
||||
mas "ReadKit - Reading Hub", id: 1615798039
|
||||
mas "Tailscale", id: 1475387142
|
||||
mas "Telegram", id: 747648890
|
||||
mas "The Unarchiver", id: 425424353
|
||||
@@ -12,7 +12,7 @@ function itsok() {
|
||||
# Runs a brew bundle check and installs missing packages
|
||||
# Usage: update-brewfile
|
||||
function update-brewfile() {
|
||||
brew bundle check --file "$HOME/.config/Brewfile" || brew bundle --cleanup -f --file "$HOME/.config/Brewfile"
|
||||
brew bundle check --global || brew bundle --cleanup -f --global
|
||||
}
|
||||
|
||||
# Updates the macOS Dock based on a configuration file
|
||||
@@ -31,6 +31,10 @@ function update-dock() {
|
||||
if [ "$app_type" = "persisentApps" ]; then
|
||||
dockutil --move "$app_name" -p $idx
|
||||
fi
|
||||
done < ~/.dotfiles/macos/.config/dockConfig.txt
|
||||
done < ~/.dotfiles/macos/.config/dotfiles/dockConfig.txt
|
||||
killall Dock
|
||||
}
|
||||
|
||||
# Override XDG cache location for macOS to use the standard Library/Caches directory
|
||||
export XDG_CACHE_HOME="$HOME/Library/Caches"
|
||||
export XDG_RUNTIME_DIR="${TMPDIR}runtime-${UID}"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# macOS aliases
|
||||
if [[ $(uname) == "Darwin" ]]; then
|
||||
alias ls="ls -FG"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Get the list of AWS profiles
|
||||
function awsprofiles() {
|
||||
profiles=$(aws --no-cli-pager configure list-profiles 2> /dev/null)
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# shellcheck shell=bash
|
||||
# User specific environment
|
||||
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
||||
|
||||
# XDG Base Directories
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_RUNTIME_DIR="${TMPDIR}/runtime-${UID}"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
PATH="$XDG_BIN_HOME:$HOME/bin:$PATH"
|
||||
export PATH
|
||||
|
||||
# User specific environment and startup programs
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Git pulls latest dotfiles
|
||||
function update-dotfiles() {
|
||||
prevdir=$PWD
|
||||
for dir in "${HOME}/.dotfiles" "${HOME}/.dotfiles-private" "${HOME}/.dotfiles-work"; do
|
||||
if [ -d "$dir" ]; then
|
||||
cd "$dir"
|
||||
git pull --rebase --autostash
|
||||
local prevdir="$PWD"
|
||||
local dotfiles_dirs=(".dotfiles" ".dotfiles-private" ".dotfiles-work")
|
||||
|
||||
for dir in "${dotfiles_dirs[@]}"; do
|
||||
if [[ -d "${HOME}/$dir" ]]; then
|
||||
if [[ ! -d "${HOME}/$dir/.git" ]]; then
|
||||
echo "Warning: $dir exists but is not a git repository. Skipping..."
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Updating $dir..."
|
||||
if cd "${HOME}/$dir" 2>/dev/null; then
|
||||
if ! git pull --rebase --autostash; then
|
||||
echo "Error: Failed to update $dir"
|
||||
fi
|
||||
else
|
||||
echo "Error: Cannot access directory $dir"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
cd "$prevdir"
|
||||
|
||||
cd "$prevdir" || echo "Warning: Could not return to original directory $prevdir"
|
||||
}
|
||||
|
||||
# Wrapper around ssh-add to easily add SSH keys with a timeout
|
||||
|
||||
@@ -1,19 +1,4 @@
|
||||
fpath+=($HOME/.config/zsh/completions)
|
||||
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
function _add-sshkey() {
|
||||
local -a identities
|
||||
|
||||
# check for .ssh folder presence
|
||||
if [[ ! -d $HOME/.ssh ]]; then
|
||||
return
|
||||
fi
|
||||
for id in $HOME/.ssh/id_ed25519_*; do
|
||||
name=$(basename $id | cut -d'_' -f3- | cut -d'.' -f1)
|
||||
[[ ${id:-3} != 'pub' ]] && identities+=$name
|
||||
done
|
||||
|
||||
compadd $identities
|
||||
}
|
||||
compdef _add-sshkey add-sshkey
|
||||
|
||||
|
||||
18
zsh/.config/zsh/completions/_add_sshkey
Normal file
18
zsh/.config/zsh/completions/_add_sshkey
Normal file
@@ -0,0 +1,18 @@
|
||||
#compdef add-sshkey
|
||||
|
||||
_add-sshkey() {
|
||||
local -a identities
|
||||
|
||||
# check for .ssh folder presence
|
||||
if [[ ! -d $HOME/.ssh ]]; then
|
||||
return
|
||||
fi
|
||||
for id in $HOME/.ssh/id_ed25519_*; do
|
||||
name=$(basename $id | cut -d'_' -f3- | cut -d'.' -f1)
|
||||
[[ ${id:-3} != 'pub' ]] && identities+=$name
|
||||
done
|
||||
|
||||
compadd $identities
|
||||
}
|
||||
|
||||
_add-sshkey "$@"
|
||||
36
zsh/.config/zsh/completions/_awslogin
Normal file
36
zsh/.config/zsh/completions/_awslogin
Normal file
@@ -0,0 +1,36 @@
|
||||
#compdef awslogin
|
||||
|
||||
_awslogin() {
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
_arguments \
|
||||
'--profile[AWS profile name]:profile:->profiles' \
|
||||
'--region[AWS region]:region:->regions'
|
||||
|
||||
case $state in
|
||||
profiles)
|
||||
local profiles
|
||||
profiles=(${(f)"$(aws --no-cli-pager configure list-profiles 2>/dev/null)"})
|
||||
_describe 'AWS profiles' profiles
|
||||
;;
|
||||
regions)
|
||||
local regions
|
||||
regions=(
|
||||
'us-east-1:US East (N. Virginia)'
|
||||
'us-east-2:US East (Ohio)'
|
||||
'us-west-1:US West (N. California)'
|
||||
'us-west-2:US West (Oregon)'
|
||||
'eu-west-1:Europe (Ireland)'
|
||||
'eu-west-2:Europe (London)'
|
||||
'eu-central-1:Europe (Frankfurt)'
|
||||
'ap-southeast-1:Asia Pacific (Singapore)'
|
||||
'ap-southeast-2:Asia Pacific (Sydney)'
|
||||
'ap-northeast-1:Asia Pacific (Tokyo)'
|
||||
)
|
||||
_describe 'AWS regions' regions
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_awslogin "$@"
|
||||
Reference in New Issue
Block a user