Compare commits
13 Commits
machines/s
...
f4e3458db0
| Author | SHA1 | Date | |
|---|---|---|---|
| f4e3458db0 | |||
| a1dfbf653d | |||
| 2836313b2f | |||
| 23a42cda46 | |||
| 2e309ce15f | |||
| 094d3f97ee | |||
| 1544056ab9 | |||
| 97dbb80e2c | |||
| 308484c7a2 | |||
| fcfeee44cb | |||
| ad5036564e | |||
| 279e5f8aa3 | |||
| 5d0ba0ae17 |
285
.config/starship.toml
Normal file
285
.config/starship.toml
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
"$schema" = 'https://starship.rs/config-schema.json'
|
||||||
|
|
||||||
|
format = """
|
||||||
|
[](red)\
|
||||||
|
$os\
|
||||||
|
$username\
|
||||||
|
[](bg:peach fg:red)\
|
||||||
|
$directory\
|
||||||
|
[](bg:yellow fg:peach)\
|
||||||
|
$git_branch\
|
||||||
|
$git_status\
|
||||||
|
[](fg:yellow bg:green)\
|
||||||
|
$c\
|
||||||
|
$rust\
|
||||||
|
$golang\
|
||||||
|
$nodejs\
|
||||||
|
$bun\
|
||||||
|
$php\
|
||||||
|
$java\
|
||||||
|
$kotlin\
|
||||||
|
$haskell\
|
||||||
|
$python\
|
||||||
|
[](fg:green bg:sapphire)\
|
||||||
|
$conda\
|
||||||
|
[](fg:sapphire bg:lavender)\
|
||||||
|
$time\
|
||||||
|
[ ](fg:lavender)\
|
||||||
|
$cmd_duration\
|
||||||
|
$line_break\
|
||||||
|
$character"""
|
||||||
|
|
||||||
|
palette = 'catppuccin_mocha'
|
||||||
|
|
||||||
|
[os]
|
||||||
|
disabled = false
|
||||||
|
style = "bg:red fg:crust"
|
||||||
|
|
||||||
|
[os.symbols]
|
||||||
|
Windows = ""
|
||||||
|
Ubuntu = ""
|
||||||
|
SUSE = ""
|
||||||
|
Raspbian = ""
|
||||||
|
Mint = ""
|
||||||
|
Macos = ""
|
||||||
|
Manjaro = ""
|
||||||
|
Linux = ""
|
||||||
|
Gentoo = ""
|
||||||
|
Fedora = ""
|
||||||
|
Alpine = ""
|
||||||
|
Amazon = ""
|
||||||
|
Android = ""
|
||||||
|
AOSC = ""
|
||||||
|
Arch = ""
|
||||||
|
Artix = ""
|
||||||
|
CentOS = ""
|
||||||
|
Debian = ""
|
||||||
|
Redhat = ""
|
||||||
|
RedHatEnterprise = ""
|
||||||
|
|
||||||
|
[username]
|
||||||
|
show_always = true
|
||||||
|
style_user = "bg:red fg:crust"
|
||||||
|
style_root = "bg:red fg:crust"
|
||||||
|
format = '[ $user]($style)'
|
||||||
|
|
||||||
|
[directory]
|
||||||
|
style = "bg:peach fg:crust"
|
||||||
|
format = "[ $path ]($style)"
|
||||||
|
truncation_length = 3
|
||||||
|
truncation_symbol = "…/"
|
||||||
|
|
||||||
|
[directory.substitutions]
|
||||||
|
"Documents" = " "
|
||||||
|
"Downloads" = " "
|
||||||
|
"Music" = " "
|
||||||
|
"Pictures" = " "
|
||||||
|
"Developer" = " "
|
||||||
|
|
||||||
|
[git_branch]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:yellow"
|
||||||
|
format = '[[ $symbol $branch ](fg:crust bg:yellow)]($style)'
|
||||||
|
|
||||||
|
[git_status]
|
||||||
|
style = "bg:yellow"
|
||||||
|
format = '[[($all_status$ahead_behind )](fg:crust bg:yellow)]($style)'
|
||||||
|
|
||||||
|
[nodejs]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[bun]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[c]
|
||||||
|
symbol = " "
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[rust]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[golang]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[php]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[java]
|
||||||
|
symbol = " "
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[kotlin]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[haskell]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[python]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:green"
|
||||||
|
format = '[[ $symbol( $version)(\(#$virtualenv\)) ](fg:crust bg:green)]($style)'
|
||||||
|
|
||||||
|
[docker_context]
|
||||||
|
symbol = ""
|
||||||
|
style = "bg:sapphire"
|
||||||
|
format = '[[ $symbol( $context) ](fg:crust bg:sapphire)]($style)'
|
||||||
|
|
||||||
|
[conda]
|
||||||
|
symbol = " "
|
||||||
|
style = "fg:crust bg:sapphire"
|
||||||
|
format = '[$symbol$environment ]($style)'
|
||||||
|
ignore_base = false
|
||||||
|
|
||||||
|
[time]
|
||||||
|
disabled = false
|
||||||
|
time_format = "%R"
|
||||||
|
style = "bg:lavender"
|
||||||
|
format = '[[ $time ](fg:crust bg:lavender)]($style)'
|
||||||
|
|
||||||
|
[line_break]
|
||||||
|
disabled = true
|
||||||
|
|
||||||
|
[character]
|
||||||
|
disabled = false
|
||||||
|
success_symbol = '[❯](bold fg:green)'
|
||||||
|
error_symbol = '[❯](bold fg:red)'
|
||||||
|
vimcmd_symbol = '[❮](bold fg:green)'
|
||||||
|
vimcmd_replace_one_symbol = '[❮](bold fg:lavender)'
|
||||||
|
vimcmd_replace_symbol = '[❮](bold fg:lavender)'
|
||||||
|
vimcmd_visual_symbol = '[❮](bold fg:yellow)'
|
||||||
|
|
||||||
|
[cmd_duration]
|
||||||
|
show_milliseconds = true
|
||||||
|
format = " in $duration "
|
||||||
|
style = "bg:lavender"
|
||||||
|
disabled = false
|
||||||
|
show_notifications = true
|
||||||
|
min_time_to_notify = 45000
|
||||||
|
|
||||||
|
[palettes.catppuccin_mocha]
|
||||||
|
rosewater = "#f5e0dc"
|
||||||
|
flamingo = "#f2cdcd"
|
||||||
|
pink = "#f5c2e7"
|
||||||
|
mauve = "#cba6f7"
|
||||||
|
red = "#f38ba8"
|
||||||
|
maroon = "#eba0ac"
|
||||||
|
peach = "#fab387"
|
||||||
|
yellow = "#f9e2af"
|
||||||
|
green = "#a6e3a1"
|
||||||
|
teal = "#94e2d5"
|
||||||
|
sky = "#89dceb"
|
||||||
|
sapphire = "#74c7ec"
|
||||||
|
blue = "#89b4fa"
|
||||||
|
lavender = "#b4befe"
|
||||||
|
text = "#cdd6f4"
|
||||||
|
subtext1 = "#bac2de"
|
||||||
|
subtext0 = "#a6adc8"
|
||||||
|
overlay2 = "#9399b2"
|
||||||
|
overlay1 = "#7f849c"
|
||||||
|
overlay0 = "#6c7086"
|
||||||
|
surface2 = "#585b70"
|
||||||
|
surface1 = "#45475a"
|
||||||
|
surface0 = "#313244"
|
||||||
|
base = "#1e1e2e"
|
||||||
|
mantle = "#181825"
|
||||||
|
crust = "#11111b"
|
||||||
|
|
||||||
|
[palettes.catppuccin_frappe]
|
||||||
|
rosewater = "#f2d5cf"
|
||||||
|
flamingo = "#eebebe"
|
||||||
|
pink = "#f4b8e4"
|
||||||
|
mauve = "#ca9ee6"
|
||||||
|
red = "#e78284"
|
||||||
|
maroon = "#ea999c"
|
||||||
|
peach = "#ef9f76"
|
||||||
|
yellow = "#e5c890"
|
||||||
|
green = "#a6d189"
|
||||||
|
teal = "#81c8be"
|
||||||
|
sky = "#99d1db"
|
||||||
|
sapphire = "#85c1dc"
|
||||||
|
blue = "#8caaee"
|
||||||
|
lavender = "#babbf1"
|
||||||
|
text = "#c6d0f5"
|
||||||
|
subtext1 = "#b5bfe2"
|
||||||
|
subtext0 = "#a5adce"
|
||||||
|
overlay2 = "#949cbb"
|
||||||
|
overlay1 = "#838ba7"
|
||||||
|
overlay0 = "#737994"
|
||||||
|
surface2 = "#626880"
|
||||||
|
surface1 = "#51576d"
|
||||||
|
surface0 = "#414559"
|
||||||
|
base = "#303446"
|
||||||
|
mantle = "#292c3c"
|
||||||
|
crust = "#232634"
|
||||||
|
|
||||||
|
[palettes.catppuccin_latte]
|
||||||
|
rosewater = "#dc8a78"
|
||||||
|
flamingo = "#dd7878"
|
||||||
|
pink = "#ea76cb"
|
||||||
|
mauve = "#8839ef"
|
||||||
|
red = "#d20f39"
|
||||||
|
maroon = "#e64553"
|
||||||
|
peach = "#fe640b"
|
||||||
|
yellow = "#df8e1d"
|
||||||
|
green = "#40a02b"
|
||||||
|
teal = "#179299"
|
||||||
|
sky = "#04a5e5"
|
||||||
|
sapphire = "#209fb5"
|
||||||
|
blue = "#1e66f5"
|
||||||
|
lavender = "#7287fd"
|
||||||
|
text = "#4c4f69"
|
||||||
|
subtext1 = "#5c5f77"
|
||||||
|
subtext0 = "#6c6f85"
|
||||||
|
overlay2 = "#7c7f93"
|
||||||
|
overlay1 = "#8c8fa1"
|
||||||
|
overlay0 = "#9ca0b0"
|
||||||
|
surface2 = "#acb0be"
|
||||||
|
surface1 = "#bcc0cc"
|
||||||
|
surface0 = "#ccd0da"
|
||||||
|
base = "#eff1f5"
|
||||||
|
mantle = "#e6e9ef"
|
||||||
|
crust = "#dce0e8"
|
||||||
|
|
||||||
|
[palettes.catppuccin_macchiato]
|
||||||
|
rosewater = "#f4dbd6"
|
||||||
|
flamingo = "#f0c6c6"
|
||||||
|
pink = "#f5bde6"
|
||||||
|
mauve = "#c6a0f6"
|
||||||
|
red = "#ed8796"
|
||||||
|
maroon = "#ee99a0"
|
||||||
|
peach = "#f5a97f"
|
||||||
|
yellow = "#eed49f"
|
||||||
|
green = "#a6da95"
|
||||||
|
teal = "#8bd5ca"
|
||||||
|
sky = "#91d7e3"
|
||||||
|
sapphire = "#7dc4e4"
|
||||||
|
blue = "#8aadf4"
|
||||||
|
lavender = "#b7bdf8"
|
||||||
|
text = "#cad3f5"
|
||||||
|
subtext1 = "#b8c0e0"
|
||||||
|
subtext0 = "#a5adcb"
|
||||||
|
overlay2 = "#939ab7"
|
||||||
|
overlay1 = "#8087a2"
|
||||||
|
overlay0 = "#6e738d"
|
||||||
|
surface2 = "#5b6078"
|
||||||
|
surface1 = "#494d64"
|
||||||
|
surface0 = "#363a4f"
|
||||||
|
base = "#24273a"
|
||||||
|
mantle = "#1e2030"
|
||||||
|
crust = "#181926"
|
||||||
14
.gitconfig
14
.gitconfig
@@ -1,3 +1,5 @@
|
|||||||
|
[core]
|
||||||
|
excludesfile = $HOME/.gitignore_global
|
||||||
[alias]
|
[alias]
|
||||||
br = branch
|
br = branch
|
||||||
brr = branch -r
|
brr = branch -r
|
||||||
@@ -12,18 +14,14 @@
|
|||||||
cop = "!f() { git checkout ${1-main}; git pull; }; f"
|
cop = "!f() { git checkout ${1-main}; git pull; }; f"
|
||||||
lazy = commit -C HEAD@{1}
|
lazy = commit -C HEAD@{1}
|
||||||
cp = cherry-pick
|
cp = cherry-pick
|
||||||
anne = commit --amend --no-edit
|
cane = commit --amend --no-edit
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
[pull]
|
[pull]
|
||||||
ff = only
|
ff = only
|
||||||
[user]
|
[color "status"]
|
||||||
name = Tom Hicks
|
added = brightgreen
|
||||||
email = headhunter3@gmail.com
|
untracked = brightred
|
||||||
[http]
|
|
||||||
lowSpeedLimit = 1000
|
|
||||||
lowSpeedTime = 60
|
|
||||||
postBuffer = 524288000
|
|
||||||
[filter "lfs"]
|
[filter "lfs"]
|
||||||
clean = git-lfs clean -- %f
|
clean = git-lfs clean -- %f
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
|||||||
|
/*
|
||||||
|
!/.*
|
||||||
/history
|
/history
|
||||||
/.vscode/extensions
|
/.vscode/extensions
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
*~
|
*~
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
._*
|
||||||
|
|||||||
30
.profile
30
.profile
@@ -1,28 +1,4 @@
|
|||||||
# ~/.profile: executed by the command interpreter for login shells.
|
. "$HOME/.cargo/env"
|
||||||
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
|
||||||
# exists.
|
|
||||||
# see /usr/share/doc/bash/examples/startup-files for examples.
|
|
||||||
# the files are located in the bash-doc package.
|
|
||||||
|
|
||||||
# the default umask is set in /etc/profile; for setting the umask
|
# Hermes Agent — ensure ~/.local/bin is on PATH
|
||||||
# for ssh logins, install and configure the libpam-umask package.
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
#umask 022
|
|
||||||
|
|
||||||
# TODO: Do this for zsh and exec $HOME/.zshrc?
|
|
||||||
# if running bash
|
|
||||||
if [ -n "$BASH_VERSION" ]; then
|
|
||||||
# include .bashrc if it exists
|
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
|
||||||
. "$HOME/.bashrc"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
|
||||||
if [ -d "$HOME/bin" ] ; then
|
|
||||||
PATH="$HOME/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
|
||||||
if [ -d "$HOME/.local/bin" ] ; then
|
|
||||||
PATH="$HOME/.local/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -210,3 +210,71 @@ alias wget-rip-lite='wget --page-requisites --convert-links --adjust-extension -
|
|||||||
alias mount-nas='mkdir -p ~/nas/tom && sshfs deepthought:/mnt/Data/Private/Homes/tom ~/nas/tom'
|
alias mount-nas='mkdir -p ~/nas/tom && sshfs deepthought:/mnt/Data/Private/Homes/tom ~/nas/tom'
|
||||||
alias installlocalbin='function f() { sudo install -m 755 -o root -g root "$1" /usr/local/bin ; unset -f f; } f'
|
alias installlocalbin='function f() { sudo install -m 755 -o root -g root "$1" /usr/local/bin ; unset -f f; } f'
|
||||||
alias installuserbin='function f() { mkdir -p ~/bin ; cp "$1" ~/bin/ ; unset -f f; } f'
|
alias installuserbin='function f() { mkdir -p ~/bin ; cp "$1" ~/bin/ ; unset -f f; } f'
|
||||||
|
|
||||||
|
packdir() {
|
||||||
|
# Check if an argument was provided
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
echo "Error: Missing folder name." >&2
|
||||||
|
echo "Usage: packdir <folder_name>" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Strip any trailing slashes to prevent name formatting issues
|
||||||
|
local target="${1%/}"
|
||||||
|
|
||||||
|
# Verify that the target exists and is a directory
|
||||||
|
if [[ ! -d "$target" ]]; then
|
||||||
|
echo "Error: Directory '$target' does not exist." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prevent accidental destruction of root or parent references
|
||||||
|
if [[ "$target" == "." || "$target" == ".." || "$target" == "/" ]]; then
|
||||||
|
echo "Error: Refusing to compress critical path '$target'." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local archive="${target}.tar.bz2"
|
||||||
|
|
||||||
|
# Verify the archive file doesn't already exist to avoid accidental overwrite
|
||||||
|
if [[ -e "$archive" ]]; then
|
||||||
|
echo "Error: Archive '$archive' already exists." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create archive and only remove the original folder if tar succeeds
|
||||||
|
tar -jcvf "$archive" "$target" && rm -rf "$target"
|
||||||
|
}
|
||||||
|
|
||||||
|
clone() {
|
||||||
|
if [ -z "$1" -o "$1" = " " -o -z "$2" -o "$2" = " " ]; then
|
||||||
|
echo "Clones the repo into \$PROJECT_ROOT/<projectName>"
|
||||||
|
echo "usage: clone <repositoryUrl> <projectName>"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clone "$1" "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use like this
|
||||||
|
# some-command && sleep 1 ; alert-me -s -t -f --success-message --success-title --failure-message --failure-title --title
|
||||||
|
# osascript -e 'display notification "The command worked" with title "Success"'
|
||||||
|
# osascript -e 'display notification "The command failed" with title "Failed"'
|
||||||
|
alert-me(){
|
||||||
|
local SUCCESS_MESSAGE="The command worked"
|
||||||
|
local SUCCESS_TITLE="Success"
|
||||||
|
local FAILURE_MESSAGE="The command failed"
|
||||||
|
local FAILURE_TITLE="Failed"
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
|
||||||
|
osascript -e "display notification \"$SUCCESS_MESSAGE\" with title \"$SUCCESS_TITLE\""
|
||||||
|
else
|
||||||
|
|
||||||
|
osascript -e "display notification \"$FAILURE_MESSAGE\" with title \"$FAILURE_TITLE\""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
alias hermes-kanban="hermes dashboard --port 9229 --skip-build --host 127.0.0.1"
|
||||||
|
|
||||||
|
|||||||
153
.rc.d/android.sh
153
.rc.d/android.sh
@@ -1,49 +1,108 @@
|
|||||||
# Android sdk
|
# Setup Android SDK environment and tools
|
||||||
# ~/Library/Android/sdk/
|
_setup_android() {
|
||||||
if [ -d "${HOME}/Library/Android/sdk" ]; then
|
[ -n "$ZSH_VERSION" ] && setopt localoptions nonomatch nullglob
|
||||||
export ANDROID_HOME="${HOME}/Library/Android/sdk"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "${HOME}/Applications/Android/cmdline-tools" ]; then
|
_add_to_path() {
|
||||||
export ANDROID_HOME="${HOME}/Applications/Android/cmdline-tools"
|
[ -d "$1" ] || return 0
|
||||||
fi
|
case ":$PATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
if [ -n "${ANDROID_HOME}" ]; then
|
*) PATH="$1:$PATH"; export PATH ;;
|
||||||
path=(${ANDROID_HOME}/cmdline-tools/latest/bin $path)
|
esac
|
||||||
# TODO: Find a way to get these versions as the latest versions in the directories.
|
|
||||||
path=(${ANDROID_HOME}/build-tools/34.0.0 $path)
|
|
||||||
path=(${ANDROID_HOME}/ndk/26.1.0909125 $path)
|
|
||||||
path=(${ANDROID_HOME}/platform-tools $path)
|
|
||||||
path=(${ANDROID_HOME}/tools $path)
|
|
||||||
path=(${ANDROID_HOME}/tools:/bin $path)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# "extras;google;simulators" "ndk;27.0.11718014" "platform-tools" "platforms;android-34" "system-images;android-34;default;arm64-v8a"
|
|
||||||
|
|
||||||
function anon() {
|
|
||||||
local android_studio_sdk_home_on_mac="$HOME/Library/Android/sdk"
|
|
||||||
local android_home=
|
|
||||||
if [ -d "$android_studio_sdk_home_on_mac" ]; then
|
|
||||||
android_home="$android_studio_sdk_home_on_mac"
|
|
||||||
elif [ -d "$android_cmdline_tools_on_mac" ]; then
|
|
||||||
android_home="$android_cmdline_tools_on_mac"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$android_home" ]; then
|
|
||||||
export ANDROID_HOME="$android_home"
|
|
||||||
if [ -d "$android_home/cmdline-tools/latest/bin" ]; then
|
|
||||||
path=("$android_home/cmdline-tools/latest/bin" $path)
|
|
||||||
fi
|
|
||||||
# TODO: Get the appropriate directories based on what is available.
|
|
||||||
path=(${ANDROID_HOME}/build-tools/34.0.0 $path)
|
|
||||||
path=(${ANDROID_HOME}/ndk/26.1.0909125 $path)
|
|
||||||
path=(${ANDROID_HOME}/platform-tools $path)
|
|
||||||
path=(${ANDROID_HOME}/tools $path)
|
|
||||||
path=(${ANDROID_HOME}/tools:/bin $path)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# "extras;google;simulators" "ndk;27.0.11718014" "platform-tools" "platforms;android-34" "system-images;android-34;default;arm64-v8a"
|
|
||||||
|
|
||||||
unset -f anon
|
|
||||||
}
|
}
|
||||||
anon
|
|
||||||
|
# Retrieve the latest versioned subdirectory using version sorting
|
||||||
|
_get_latest_subdir() {
|
||||||
|
[ -d "$1" ] || return 1
|
||||||
|
_latest=$(
|
||||||
|
for _d in "$1"/*; do
|
||||||
|
[ -d "$_d" ] && basename "$_d"
|
||||||
|
done | { sort -V 2>/dev/null || sort -n 2>/dev/null || sort; } | tail -n 1
|
||||||
|
)
|
||||||
|
if [ -n "$_latest" ] && [ -d "$1/$_latest" ]; then
|
||||||
|
echo "$1/$_latest"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Common SDK search locations in priority order (macOS, Linux, WSL)
|
||||||
|
# The first directory found will be selected and configured.
|
||||||
|
_sdk_candidates=(
|
||||||
|
"${ANDROID_HOME:-}"
|
||||||
|
"${ANDROID_SDK_ROOT:-}"
|
||||||
|
"$HOME/Library/Android/sdk" # macOS Android Studio default
|
||||||
|
"$HOME/Android/Sdk" # Linux / WSL Android Studio default
|
||||||
|
"$HOME/android-sdk" # Common user manual install
|
||||||
|
"$HOME/.android/sdk"
|
||||||
|
"$HOME/Applications/Android/sdk"
|
||||||
|
"$HOME/Applications/Android/cmdline-tools"
|
||||||
|
"/usr/lib/android-sdk" # Linux distribution package (e.g. apt)
|
||||||
|
"/opt/android-sdk" # Linux system manual install
|
||||||
|
"/opt/android/sdk"
|
||||||
|
"/var/lib/android-sdk"
|
||||||
|
"/opt/homebrew/share/android-commandlinetools" # macOS Apple Silicon Homebrew
|
||||||
|
"/opt/homebrew/share/android-sdk"
|
||||||
|
"/usr/local/share/android-commandlinetools" # macOS Intel Homebrew
|
||||||
|
"/usr/local/share/android-sdk"
|
||||||
|
"/Library/Android/sdk" # macOS system-wide install
|
||||||
|
)
|
||||||
|
|
||||||
|
_found_sdk=""
|
||||||
|
for _dir in "${_sdk_candidates[@]}"; do
|
||||||
|
if [ -n "$_dir" ] && [ -d "$_dir" ]; then
|
||||||
|
_found_sdk="$_dir"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -z "$_found_sdk" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set SDK environment variables
|
||||||
|
export ANDROID_HOME="$_found_sdk"
|
||||||
|
export ANDROID_SDK_ROOT="$_found_sdk"
|
||||||
|
|
||||||
|
# Find the most recent build-tools
|
||||||
|
_build_tools_dir=""
|
||||||
|
if [ -d "$_found_sdk/build-tools" ]; then
|
||||||
|
_build_tools_dir=$(_get_latest_subdir "$_found_sdk/build-tools")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find the most recent NDK
|
||||||
|
_ndk_dir=""
|
||||||
|
if [ -d "$_found_sdk/ndk" ]; then
|
||||||
|
_ndk_dir=$(_get_latest_subdir "$_found_sdk/ndk")
|
||||||
|
elif [ -d "$_found_sdk/ndk-bundle" ]; then
|
||||||
|
_ndk_dir="$_found_sdk/ndk-bundle"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$_ndk_dir" ] && [ -d "$_ndk_dir" ]; then
|
||||||
|
export NDK_HOME="$_ndk_dir"
|
||||||
|
export ANDROID_NDK_HOME="$_ndk_dir"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Find cmdline-tools (prefer 'latest', then highest version, then root bin)
|
||||||
|
_cmdline_tools_bin=""
|
||||||
|
if [ -d "$_found_sdk/cmdline-tools/latest/bin" ]; then
|
||||||
|
_cmdline_tools_bin="$_found_sdk/cmdline-tools/latest/bin"
|
||||||
|
elif [ -d "$_found_sdk/cmdline-tools" ]; then
|
||||||
|
_latest_cmdline=$(_get_latest_subdir "$_found_sdk/cmdline-tools")
|
||||||
|
if [ -n "$_latest_cmdline" ] && [ -d "$_latest_cmdline/bin" ]; then
|
||||||
|
_cmdline_tools_bin="$_latest_cmdline/bin"
|
||||||
|
fi
|
||||||
|
elif [ -d "$_found_sdk/bin" ]; then
|
||||||
|
_cmdline_tools_bin="$_found_sdk/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepend tools to PATH in reverse priority so most critical are at front
|
||||||
|
_add_to_path "$_found_sdk/tools"
|
||||||
|
_add_to_path "$_found_sdk/tools/bin"
|
||||||
|
[ -n "$_ndk_dir" ] && _add_to_path "$_ndk_dir"
|
||||||
|
[ -n "$_build_tools_dir" ] && _add_to_path "$_build_tools_dir"
|
||||||
|
_add_to_path "$_found_sdk/emulator"
|
||||||
|
_add_to_path "$_found_sdk/platform-tools"
|
||||||
|
[ -n "$_cmdline_tools_bin" ] && _add_to_path "$_cmdline_tools_bin"
|
||||||
|
}
|
||||||
|
_setup_android
|
||||||
|
unset -f _setup_android _add_to_path _get_latest_subdir
|
||||||
|
|||||||
110
.rc.d/c64.sh
110
.rc.d/c64.sh
@@ -1,9 +1,105 @@
|
|||||||
if [ -f "$HOME/Applications/KickAssembler/KickAss.jar" ]; then
|
# Setup Commodore 64 development environment (KickAssembler & VICE)
|
||||||
# TODO: typeset may fail if CLASSPATH is already tied by another script. Handle this.
|
_setup_c64() {
|
||||||
typeset -T CLASSPATH classpath
|
[ -n "$ZSH_VERSION" ] && setopt localoptions nonomatch nullglob
|
||||||
classpath+="$HOME/Applications/KickAssembler/KickAss.jar"
|
|
||||||
export CLASSPATH
|
_add_to_path() {
|
||||||
|
[ -d "$1" ] || return 0
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*) PATH="$1:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_add_to_classpath() {
|
||||||
|
[ -f "$1" ] || return 0
|
||||||
|
case ":$CLASSPATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*) CLASSPATH="${CLASSPATH:+$CLASSPATH:}$1"; export CLASSPATH ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1. KickAssembler search locations (macOS and Linux)
|
||||||
|
_kickass_candidates=(
|
||||||
|
"${KICKASS_JAR:-}"
|
||||||
|
"${KICKASS_HOME:-}/KickAss.jar"
|
||||||
|
"${KICKASSEMBLER_HOME:-}/KickAss.jar"
|
||||||
|
"$HOME/Applications/KickAssembler/KickAss.jar"
|
||||||
|
"$HOME/Applications/KickAssembler/kickass.jar"
|
||||||
|
"/Applications/KickAssembler/KickAss.jar"
|
||||||
|
"/Applications/KickAssembler/kickass.jar"
|
||||||
|
"$HOME/Applications/KickAss/KickAss.jar"
|
||||||
|
"/Applications/KickAss/KickAss.jar"
|
||||||
|
"/opt/homebrew/share/kickassembler/KickAss.jar"
|
||||||
|
"/usr/local/share/kickassembler/KickAss.jar"
|
||||||
|
"/opt/kickassembler/KickAss.jar"
|
||||||
|
"/usr/share/kickassembler/KickAss.jar"
|
||||||
|
"$HOME/.local/share/kickassembler/KickAss.jar"
|
||||||
|
"$HOME/kickassembler/KickAss.jar"
|
||||||
|
"$HOME/KickAssembler/KickAss.jar"
|
||||||
|
)
|
||||||
|
|
||||||
|
_found_kickass_jar=""
|
||||||
|
for _jar in "${_kickass_candidates[@]}"; do
|
||||||
|
if [ -n "$_jar" ] && [ -f "$_jar" ]; then
|
||||||
|
_found_kickass_jar="$_jar"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
if [ -d "/Applications/VICE/bin" ]; then
|
done
|
||||||
path=(/Applications/VICE/bin $path)
|
|
||||||
|
if [ -n "$_found_kickass_jar" ]; then
|
||||||
|
_add_to_classpath "$_found_kickass_jar"
|
||||||
|
_kickass_dir="$(dirname "$_found_kickass_jar")"
|
||||||
|
_add_to_path "$_kickass_dir"
|
||||||
|
export KICKASS_HOME="$_kickass_dir"
|
||||||
|
export KICKASS_JAR="$_found_kickass_jar"
|
||||||
|
|
||||||
|
if ! command -v kickass >/dev/null 2>&1; then
|
||||||
|
kickass() {
|
||||||
|
java -jar "$KICKASS_JAR" "$@"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. VICE search locations (macOS and Linux)
|
||||||
|
_vice_candidates=(
|
||||||
|
"${VICE_HOME:-}/bin"
|
||||||
|
"${VICE_HOME:-}"
|
||||||
|
"$HOME/Applications/VICE/bin"
|
||||||
|
"/Applications/VICE/bin"
|
||||||
|
"$HOME/Applications/VICE.app/Contents/Resources/bin"
|
||||||
|
"/Applications/VICE.app/Contents/Resources/bin"
|
||||||
|
"$HOME/Applications/VICE.app/Contents/MacOS"
|
||||||
|
"/Applications/VICE.app/Contents/MacOS"
|
||||||
|
"/opt/homebrew/opt/vice/bin"
|
||||||
|
"/opt/homebrew/bin"
|
||||||
|
"/usr/local/opt/vice/bin"
|
||||||
|
"/usr/local/bin"
|
||||||
|
"/opt/vice/bin"
|
||||||
|
"/usr/bin"
|
||||||
|
)
|
||||||
|
|
||||||
|
_found_vice_bin=""
|
||||||
|
for _vdir in "${_vice_candidates[@]}"; do
|
||||||
|
if [ -n "$_vdir" ] && [ -d "$_vdir" ]; then
|
||||||
|
if [ -x "$_vdir/x64sc" ] || [ -x "$_vdir/x64" ] || [ -x "$_vdir/c1541" ] || [ -x "$_vdir/vice" ]; then
|
||||||
|
_found_vice_bin="$_vdir"
|
||||||
|
break
|
||||||
|
elif case "$_vdir" in *VICE*bin*|*vice*bin*) true ;; *) false ;; esac; then
|
||||||
|
_found_vice_bin="$_vdir"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$_found_vice_bin" ]; then
|
||||||
|
_add_to_path "$_found_vice_bin"
|
||||||
|
if [ -z "$VICE_HOME" ]; then
|
||||||
|
case "$_found_vice_bin" in
|
||||||
|
*/bin) export VICE_HOME="$(dirname "$_found_vice_bin")" ;;
|
||||||
|
*) export VICE_HOME="$_found_vice_bin" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
_setup_c64
|
||||||
|
unset -f _setup_c64 _add_to_path _add_to_classpath
|
||||||
|
|||||||
@@ -1,7 +1,44 @@
|
|||||||
if [ -f "/opt/homebrew/bin/fortune" ]; then
|
# Display fortune (with cowsay if available) in top-level interactive shells
|
||||||
if [ -f "/opt/homebrew/bin/cowsay" ]; then
|
# (new iTerm2 tabs/windows, xterm, console, VS Code / IntelliJ terminals).
|
||||||
/opt/homebrew/bin/fortune | /opt/homebrew/bin/cowsay
|
# Subshells (e.g. typing 'bash' or 'zsh' inside an existing terminal) are skipped.
|
||||||
|
case $- in
|
||||||
|
*i*) ;;
|
||||||
|
*) return 0 2>/dev/null || exit 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Skip nested subshells (SHLVL > 1)
|
||||||
|
if [ "${SHLVL:-1}" -gt 1 ]; then
|
||||||
|
return 0 2>/dev/null || exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
_fortune_cmd=""
|
||||||
|
if command -v fortune >/dev/null 2>&1; then
|
||||||
|
_fortune_cmd="fortune"
|
||||||
|
elif [ -x "/opt/homebrew/bin/fortune" ]; then
|
||||||
|
_fortune_cmd="/opt/homebrew/bin/fortune"
|
||||||
|
elif [ -x "/usr/games/fortune" ]; then
|
||||||
|
_fortune_cmd="/usr/games/fortune"
|
||||||
|
elif [ -x "/usr/local/bin/fortune" ]; then
|
||||||
|
_fortune_cmd="/usr/local/bin/fortune"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$_fortune_cmd" ]; then
|
||||||
|
_cowsay_cmd=""
|
||||||
|
if command -v cowsay >/dev/null 2>&1; then
|
||||||
|
_cowsay_cmd="cowsay"
|
||||||
|
elif [ -x "/opt/homebrew/bin/cowsay" ]; then
|
||||||
|
_cowsay_cmd="/opt/homebrew/bin/cowsay"
|
||||||
|
elif [ -x "/usr/games/cowsay" ]; then
|
||||||
|
_cowsay_cmd="/usr/games/cowsay"
|
||||||
|
elif [ -x "/usr/local/bin/cowsay" ]; then
|
||||||
|
_cowsay_cmd="/usr/local/bin/cowsay"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$_cowsay_cmd" ]; then
|
||||||
|
"$_fortune_cmd" | "$_cowsay_cmd"
|
||||||
else
|
else
|
||||||
/opt/homebrew/bin/fortune
|
"$_fortune_cmd"
|
||||||
fi
|
fi
|
||||||
|
unset _cowsay_cmd
|
||||||
fi
|
fi
|
||||||
|
unset _fortune_cmd
|
||||||
|
|||||||
78
.rc.d/fzf.sh
78
.rc.d/fzf.sh
@@ -1,16 +1,64 @@
|
|||||||
# To set up shell integration, add this to your shell configuration file:
|
# Setup fzf shell integration (bash, zsh, and fallback paths)
|
||||||
# # bash
|
_setup_fzf() {
|
||||||
# eval "$(fzf --bash)"
|
# Ensure fzf binary is accessible if installed in common locations
|
||||||
|
if ! command -v fzf >/dev/null 2>&1; then
|
||||||
# # zsh
|
for _fzf_bin_dir in \
|
||||||
# source <(fzf --zsh)
|
"/opt/homebrew/bin" \
|
||||||
|
"/usr/local/bin" \
|
||||||
# # fish
|
"$HOME/.fzf/bin" \
|
||||||
# fzf --fish | source
|
"$HOME/.local/bin"
|
||||||
|
do
|
||||||
# To use fzf in Vim, add the following line to your .vimrc:
|
if [ -x "$_fzf_bin_dir/fzf" ]; then
|
||||||
# set rtp+=/opt/homebrew/opt/fzf
|
case ":$PATH:" in
|
||||||
|
*":$_fzf_bin_dir:"*) ;;
|
||||||
if [ -x "$(which fzf)" ]; then
|
*) PATH="$_fzf_bin_dir:$PATH"; export PATH ;;
|
||||||
source <(fzf --zsh)
|
esac
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
command -v fzf >/dev/null 2>&1 || return 0
|
||||||
|
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
if fzf --bash >/dev/null 2>&1; then
|
||||||
|
eval "$(fzf --bash)"
|
||||||
|
else
|
||||||
|
# Fallback for older fzf versions
|
||||||
|
for _dir in \
|
||||||
|
"/opt/homebrew/opt/fzf/shell" \
|
||||||
|
"/usr/local/opt/fzf/shell" \
|
||||||
|
"$HOME/.fzf/shell" \
|
||||||
|
"/usr/share/doc/fzf/examples" \
|
||||||
|
"/usr/share/fzf"
|
||||||
|
do
|
||||||
|
if [ -d "$_dir" ]; then
|
||||||
|
[ -r "$_dir/completion.bash" ] && \. "$_dir/completion.bash"
|
||||||
|
[ -r "$_dir/key-bindings.bash" ] && \. "$_dir/key-bindings.bash"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
elif [ -n "$ZSH_VERSION" ]; then
|
||||||
|
if fzf --zsh >/dev/null 2>&1; then
|
||||||
|
eval "$(fzf --zsh)"
|
||||||
|
else
|
||||||
|
# Fallback for older fzf versions
|
||||||
|
for _dir in \
|
||||||
|
"/opt/homebrew/opt/fzf/shell" \
|
||||||
|
"/usr/local/opt/fzf/shell" \
|
||||||
|
"$HOME/.fzf/shell" \
|
||||||
|
"/usr/share/doc/fzf/examples" \
|
||||||
|
"/usr/share/fzf"
|
||||||
|
do
|
||||||
|
if [ -d "$_dir" ]; then
|
||||||
|
[ -r "$_dir/completion.zsh" ] && \. "$_dir/completion.zsh"
|
||||||
|
[ -r "$_dir/key-bindings.zsh" ] && \. "$_dir/key-bindings.zsh"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
_setup_fzf
|
||||||
|
unset -f _setup_fzf
|
||||||
|
|||||||
@@ -1,7 +1,60 @@
|
|||||||
function anon() {
|
# Setup iTerm2 shell integration on macOS
|
||||||
local script_path="$HOME/.iterm2_shell_integration.zsh"
|
_setup_iterm2() {
|
||||||
if [ "$TERM_PROGRAM" = "iTerm.app" -a -e "$script_path" ]; then
|
# Only run on macOS
|
||||||
source "$script_path"
|
[ "$(uname -s 2>/dev/null)" = "Darwin" ] || return 0
|
||||||
|
|
||||||
|
# Only run if iTerm.app is available in /Applications or $HOME/Applications
|
||||||
|
_iterm_app=""
|
||||||
|
for _app_cand in \
|
||||||
|
"/Applications/iTerm.app" \
|
||||||
|
"$HOME/Applications/iTerm.app" \
|
||||||
|
"/Applications/ITerm.app" \
|
||||||
|
"$HOME/Applications/ITerm.app" \
|
||||||
|
"/Applications/iTerm2.app" \
|
||||||
|
"$HOME/Applications/iTerm2.app"
|
||||||
|
do
|
||||||
|
if [ -d "$_app_cand" ]; then
|
||||||
|
_iterm_app="$_app_cand"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
[ -n "$_iterm_app" ] || return 0
|
||||||
|
|
||||||
|
# Add iTerm2 utilities (imgcat, it2dl, etc.) to PATH if available
|
||||||
|
if [ -d "$_iterm_app/Contents/Resources/utilities" ]; then
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$_iterm_app/Contents/Resources/utilities:"*) ;;
|
||||||
|
*) PATH="$_iterm_app/Contents/Resources/utilities:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only activate shell integration when running inside iTerm
|
||||||
|
if [ "$TERM_PROGRAM" = "iTerm.app" ] || [ -n "$ITERM_SESSION_ID" ] || [ "$LC_TERMINAL" = "iTerm2" ]; then
|
||||||
|
_shell_ext=""
|
||||||
|
if [ -n "$ZSH_VERSION" ]; then
|
||||||
|
_shell_ext="zsh"
|
||||||
|
elif [ -n "$BASH_VERSION" ]; then
|
||||||
|
_shell_ext="bash"
|
||||||
|
elif [ -n "$FISH_VERSION" ]; then
|
||||||
|
_shell_ext="fish"
|
||||||
|
elif [ -n "$tcsh" ]; then
|
||||||
|
_shell_ext="tcsh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$_shell_ext" ]; then
|
||||||
|
_script_path=""
|
||||||
|
if [ -r "$HOME/.iterm2_shell_integration.$_shell_ext" ]; then
|
||||||
|
_script_path="$HOME/.iterm2_shell_integration.$_shell_ext"
|
||||||
|
elif [ -r "$_iterm_app/Contents/Resources/iterm2_shell_integration.$_shell_ext" ]; then
|
||||||
|
_script_path="$_iterm_app/Contents/Resources/iterm2_shell_integration.$_shell_ext"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$_script_path" ]; then
|
||||||
|
\. "$_script_path"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
unset -f anon
|
_setup_iterm2
|
||||||
|
unset -f _setup_iterm2
|
||||||
|
|||||||
171
.rc.d/java.sh
171
.rc.d/java.sh
@@ -1,18 +1,159 @@
|
|||||||
# TODO: Use find to get subdirs. Filter by vendor. Filter by version. Find the "best" version/vendor combo.
|
# Setup Java environment (JAVA_HOME, JDK_HOME, and PATH)
|
||||||
# Highest microsoft version, if not fallback to highest non-ms version
|
_setup_java() {
|
||||||
# Brew has graalvm (17,21), microsoft (11,17,21), oracle(17,21), sapmachine, semeru (8,11,17,21)
|
[ -n "$ZSH_VERSION" ] && setopt localoptions nonomatch nullglob
|
||||||
if [ -z "${JAVA_HOME}" -a -d "/Library/Java/JavaVirtualMachines/microsoft-21.jdk/Contents/Home" ]; then
|
|
||||||
JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-21.jdk/Contents/Home
|
_is_valid_jre() {
|
||||||
elif [ -z "${JAVA_HOME}" -a -d "/Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home" ]; then
|
[ -n "$1" ] && [ -d "$1" ] && [ -x "$1/bin/java" ]
|
||||||
JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home
|
}
|
||||||
elif [ -z "${JAVA_HOME}" -a -d "/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home" ]; then
|
|
||||||
JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home
|
_is_valid_jdk() {
|
||||||
elif [ -z "${JAVA_HOME}" -a -d "/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home" ]; then
|
_is_valid_jre "$1" && [ -x "$1/bin/javac" ]
|
||||||
JAVA_HOME=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
|
}
|
||||||
|
|
||||||
|
_add_to_path() {
|
||||||
|
[ -d "$1" ] || return 0
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*) PATH="$1:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1. If user already has a valid JAVA_HOME configured, respect it
|
||||||
|
_has_user_jre=0
|
||||||
|
if _is_valid_jre "${JAVA_HOME:-}"; then
|
||||||
|
_has_user_jre=1
|
||||||
|
_add_to_path "$JAVA_HOME/bin"
|
||||||
|
if _is_valid_jdk "$JAVA_HOME"; then
|
||||||
|
[ -z "$JDK_HOME" ] && export JDK_HOME="$JAVA_HOME"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$JAVA_HOME" ]; then
|
# If both a valid JRE (JAVA_HOME) and JDK (JDK_HOME) are already configured, we are done
|
||||||
path=("$JAVA_HOME/bin" $path)
|
if [ "$_has_user_jre" -eq 1 ] && [ -n "$JDK_HOME" ] && _is_valid_jdk "$JDK_HOME"; then
|
||||||
export JAVA_HOME
|
return 0
|
||||||
export PATH
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 2. Gather candidates across macOS and Linux
|
||||||
|
_candidates=()
|
||||||
|
|
||||||
|
# macOS tool: /usr/libexec/java_home
|
||||||
|
if [ "$(uname -s 2>/dev/null)" = "Darwin" ] && [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
_jh=$(/usr/libexec/java_home 2>/dev/null)
|
||||||
|
[ -n "$_jh" ] && _candidates+=("$_jh")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Linux tools: update-java-alternatives (Debian/Ubuntu) and readlink on java command
|
||||||
|
if command -v update-java-alternatives >/dev/null 2>&1; then
|
||||||
|
for _alt_path in $(update-java-alternatives -l 2>/dev/null | awk '{print $NF}'); do
|
||||||
|
[ -d "$_alt_path" ] && _candidates+=("$_alt_path")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v java >/dev/null 2>&1; then
|
||||||
|
_java_bin=$(command -v java 2>/dev/null)
|
||||||
|
if command -v readlink >/dev/null 2>&1; then
|
||||||
|
_real_java=$(readlink -f "$_java_bin" 2>/dev/null)
|
||||||
|
if [ -n "$_real_java" ] && [ -x "$_real_java" ]; then
|
||||||
|
_alt_home="$(dirname "$(dirname "$_real_java")")"
|
||||||
|
[ -n "$_alt_home" ] && _candidates+=("$_alt_home")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cross-platform user managers (SDKMAN)
|
||||||
|
[ -d "$HOME/.sdkman/candidates/java/current" ] && _candidates+=("$HOME/.sdkman/candidates/java/current")
|
||||||
|
|
||||||
|
# macOS locations
|
||||||
|
if [ "$(uname -s 2>/dev/null)" = "Darwin" ]; then
|
||||||
|
# Homebrew OpenJDK
|
||||||
|
for _d in /opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home \
|
||||||
|
/opt/homebrew/opt/openjdk@*/libexec/openjdk.jdk/Contents/Home \
|
||||||
|
/usr/local/opt/openjdk/libexec/openjdk.jdk/Contents/Home; do
|
||||||
|
[ -d "$_d" ] && _candidates+=("$_d")
|
||||||
|
done
|
||||||
|
|
||||||
|
# Installed JVMs in /Library/Java/JavaVirtualMachines and ~/Library/...
|
||||||
|
# Version-sorted descending to prefer newer releases
|
||||||
|
for _d in $(
|
||||||
|
for _jvm in /Library/Java/JavaVirtualMachines/*/Contents/Home \
|
||||||
|
"$HOME/Library/Java/JavaVirtualMachines"/*/Contents/Home; do
|
||||||
|
[ -d "$_jvm" ] && echo "$_jvm"
|
||||||
|
done | sort -V -r 2>/dev/null
|
||||||
|
); do
|
||||||
|
_candidates+=("$_d")
|
||||||
|
done
|
||||||
|
|
||||||
|
# Android Studio bundled JBR/JDK
|
||||||
|
for _d in \
|
||||||
|
"/Applications/Android Studio.app/Contents/jbr/Contents/Home" \
|
||||||
|
"/Applications/Android Studio.app/Contents/jre/Contents/Home" \
|
||||||
|
"/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home" \
|
||||||
|
"$HOME/Applications/Android Studio.app/Contents/jbr/Contents/Home" \
|
||||||
|
"$HOME/Applications/Android Studio.app/Contents/jre/Contents/Home"
|
||||||
|
do
|
||||||
|
[ -d "$_d" ] && _candidates+=("$_d")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Linux / WSL locations
|
||||||
|
if [ "$(uname -s 2>/dev/null)" = "Linux" ]; then
|
||||||
|
# Default java symlink on Debian/Ubuntu
|
||||||
|
[ -d "/usr/lib/jvm/default-java" ] && _candidates+=("/usr/lib/jvm/default-java")
|
||||||
|
|
||||||
|
# Distribution JVMs in /usr/lib/jvm, version-sorted descending
|
||||||
|
for _d in $(
|
||||||
|
for _jvm in /usr/lib/jvm/*; do
|
||||||
|
[ -d "$_jvm" ] && echo "$_jvm"
|
||||||
|
done | sort -V -r 2>/dev/null
|
||||||
|
); do
|
||||||
|
_candidates+=("$_d")
|
||||||
|
done
|
||||||
|
|
||||||
|
for _d in \
|
||||||
|
"/usr/java/latest" \
|
||||||
|
"/usr/java/default" \
|
||||||
|
"/opt/android-studio/jbr" \
|
||||||
|
"/opt/android-studio/jre" \
|
||||||
|
"$HOME/android-studio/jbr" \
|
||||||
|
"$HOME/.local/share/JetBrains/Toolbox/apps/android-studio/jbr"
|
||||||
|
do
|
||||||
|
[ -d "$_d" ] && _candidates+=("$_d")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Evaluate candidates: find best JRE (preferring SDK JREs) and best JDK
|
||||||
|
_best_jdk=""
|
||||||
|
_best_jre=""
|
||||||
|
|
||||||
|
for _cand in "${_candidates[@]}"; do
|
||||||
|
if [ -n "$_cand" ]; then
|
||||||
|
if _is_valid_jdk "$_cand"; then
|
||||||
|
[ -z "$_best_jdk" ] && _best_jdk="$_cand"
|
||||||
|
[ -z "$_best_jre" ] && _best_jre="$_cand"
|
||||||
|
elif _is_valid_jre "$_cand"; then
|
||||||
|
[ -z "$_best_jre" ] && _best_jre="$_cand"
|
||||||
|
fi
|
||||||
|
if [ -n "$_best_jdk" ] && [ -n "$_best_jre" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# 4. If no valid JAVA_HOME was set by user, configure it with best JRE (preferring SDK)
|
||||||
|
if [ "$_has_user_jre" -eq 0 ] && [ -n "$_best_jre" ]; then
|
||||||
|
export JAVA_HOME="$_best_jre"
|
||||||
|
_add_to_path "$JAVA_HOME/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. If no SDK/JDK_HOME is set, configure it with best JDK
|
||||||
|
if [ -z "$JDK_HOME" ] || ! _is_valid_jdk "$JDK_HOME"; then
|
||||||
|
if _is_valid_jdk "${JAVA_HOME:-}"; then
|
||||||
|
export JDK_HOME="$JAVA_HOME"
|
||||||
|
elif [ -n "$_best_jdk" ]; then
|
||||||
|
export JDK_HOME="$_best_jdk"
|
||||||
|
_add_to_path "$_best_jdk/bin"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
_setup_java
|
||||||
|
unset -f _setup_java _is_valid_jre _is_valid_jdk _add_to_path
|
||||||
|
|||||||
@@ -194,5 +194,6 @@ These values are the same for foreground and background. The bright colors are o
|
|||||||
| Setgid (g+s) | Bright Yellow | Bright Red | DB |
|
| Setgid (g+s) | Bright Yellow | Bright Red | DB |
|
||||||
| SOW (+t,o+w) | Bright Red | Green | Bc |
|
| SOW (+t,o+w) | Bright Red | Green | Bc |
|
||||||
| Sticky (+t) | Bright Red | Yellow | Bd |
|
| Sticky (+t) | Bright Red | Yellow | Bd |
|
||||||
|
| Cloud Only |
|
||||||
|
|
||||||
`export LSCOLORS=FxGxedGdCxxExFHBDBBcBd`
|
`export LSCOLORS=FxGxedGdCxxExFHBDBBcBd`
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# zsh
|
# See ls-color.md for an explanation of the formats.
|
||||||
export LSCOLORS=FxGxedGdCxxExFHBDBbcbd
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
|
||||||
# bash
|
|
||||||
export LS_COLORS="rs=0:di=95:ln=36:mh=00:pi=96;43:so=34;43:do=34;43:bd=104:cd=105:or=5;96;40:mi=5;30;46:su=97;101:sg=93;101:ca=00:tw=91;42:ow=91;43:st=42:ex=92:*.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:*.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:*.ogv=01;35:*.ogx=01;35:*.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:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:"
|
export LS_COLORS="rs=0:di=95:ln=36:mh=00:pi=96;43:so=34;43:do=34;43:bd=104:cd=105:or=5;96;40:mi=5;30;46:su=97;101:sg=93;101:ca=00:tw=91;42:ow=91;43:st=42:ex=92:*.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:*.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:*.ogv=01;35:*.ogx=01;35:*.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:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:"
|
||||||
|
elif [ -n "$ZSH_VERSION" ]; then
|
||||||
|
export LSCOLORS=FxGxedGdCxxExFHBDBbcbdxx
|
||||||
|
fi
|
||||||
|
|||||||
92
.rc.d/node.sh
Normal file
92
.rc.d/node.sh
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# Setup Node.js environment: NVM (preferred), system/fallback Node, NPM global bin, and Yarn
|
||||||
|
_setup_node() {
|
||||||
|
_add_to_path() {
|
||||||
|
[ -d "$1" ] || return 0
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*) PATH="$1:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_nvm_active=0
|
||||||
|
|
||||||
|
# 1. Check for NVM and prefer NVM node version
|
||||||
|
if [ -z "$NVM_DIR" ]; then
|
||||||
|
if [ -d "$HOME/.nvm" ]; then
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
elif [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/nvm" ]; then
|
||||||
|
export NVM_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/nvm"
|
||||||
|
elif [ -d "/opt/homebrew/opt/nvm" ]; then
|
||||||
|
export NVM_DIR="/opt/homebrew/opt/nvm"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$NVM_DIR" ] && [ -d "$NVM_DIR" ]; then
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||||
|
|
||||||
|
if command -v nvm >/dev/null 2>&1 || type nvm >/dev/null 2>&1; then
|
||||||
|
nvm use --silent 2>/dev/null || nvm use --silent default 2>/dev/null || nvm use --silent node 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$NVM_BIN" ] && [ -d "$NVM_BIN" ]; then
|
||||||
|
_nvm_active=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. If NVM is not available or has no active node, fallback to system/global node installs
|
||||||
|
if [ "$_nvm_active" -eq 0 ]; then
|
||||||
|
if ! command -v node >/dev/null 2>&1; then
|
||||||
|
for _node_dir in \
|
||||||
|
/opt/homebrew/opt/node/bin \
|
||||||
|
/opt/homebrew/bin \
|
||||||
|
/usr/local/bin \
|
||||||
|
/usr/bin \
|
||||||
|
/usr/local/nodejs/bin \
|
||||||
|
/usr/local/node/bin \
|
||||||
|
"$HOME/.local/bin"
|
||||||
|
do
|
||||||
|
if [ -x "$_node_dir/node" ]; then
|
||||||
|
_add_to_path "$_node_dir"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Setup NPM global binaries (for system node or custom npm prefix)
|
||||||
|
if [ "$_nvm_active" -eq 0 ] && command -v npm >/dev/null 2>&1; then
|
||||||
|
_npm_prefix="$(npm config get prefix 2>/dev/null || npm prefix -g 2>/dev/null)"
|
||||||
|
if [ -n "$_npm_prefix" ] && [ -d "$_npm_prefix/bin" ]; then
|
||||||
|
_add_to_path "$_npm_prefix/bin"
|
||||||
|
fi
|
||||||
|
unset _npm_prefix
|
||||||
|
elif [ -d "$HOME/.npm-global/bin" ]; then
|
||||||
|
_add_to_path "$HOME/.npm-global/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. Setup Yarn global bin if yarn is available
|
||||||
|
if command -v yarn >/dev/null 2>&1; then
|
||||||
|
_yarn_bin="$(yarn global bin 2>/dev/null)"
|
||||||
|
if [ -n "$_yarn_bin" ] && [ -d "$_yarn_bin" ]; then
|
||||||
|
_add_to_path "$_yarn_bin"
|
||||||
|
fi
|
||||||
|
unset _yarn_bin
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. Guarantee NVM active node takes precedence over any global node in PATH
|
||||||
|
if [ "$_nvm_active" -eq 1 ] && [ -n "$NVM_BIN" ] && [ -d "$NVM_BIN" ]; then
|
||||||
|
_clean_path=":$PATH:"
|
||||||
|
_clean_path="${_clean_path//:$NVM_BIN:/:}"
|
||||||
|
_clean_path="${_clean_path#:}"
|
||||||
|
_clean_path="${_clean_path%:}"
|
||||||
|
PATH="$NVM_BIN:$_clean_path"
|
||||||
|
export PATH
|
||||||
|
unset _clean_path
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset _nvm_active
|
||||||
|
}
|
||||||
|
_setup_node
|
||||||
|
unset -f _setup_node _add_to_path
|
||||||
|
|
||||||
0
.rc.d/noop.bash
Normal file
0
.rc.d/noop.bash
Normal file
0
.rc.d/noop.zsh
Normal file
0
.rc.d/noop.zsh
Normal file
11
.rc.d/nvm.sh
11
.rc.d/nvm.sh
@@ -1,11 +0,0 @@
|
|||||||
function anon() {
|
|
||||||
local nvm_dir="$HOME/.nvm"
|
|
||||||
|
|
||||||
if [ -d $nvm_dir ]; then
|
|
||||||
[ -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
|
|
||||||
export NVM_DIR=$nvm_dir
|
|
||||||
fi
|
|
||||||
unset -f anon
|
|
||||||
}
|
|
||||||
anon
|
|
||||||
48
.rc.d/pkgconfig.sh
Normal file
48
.rc.d/pkgconfig.sh
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Setup PKG_CONFIG_PATH for Apple Silicon Homebrew on macOS and LSB/standard paths on Linux
|
||||||
|
_setup_pkgconfig() {
|
||||||
|
[ -n "$ZSH_VERSION" ] && setopt localoptions nonomatch nullglob
|
||||||
|
|
||||||
|
_add_pkg_config_path() {
|
||||||
|
[ -d "$1" ] || return 0
|
||||||
|
case ":${PKG_CONFIG_PATH}:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*)
|
||||||
|
if [ -n "$PKG_CONFIG_PATH" ]; then
|
||||||
|
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$1"
|
||||||
|
else
|
||||||
|
PKG_CONFIG_PATH="$1"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# macOS: Apple Silicon Homebrew
|
||||||
|
if [ -d "/opt/homebrew" ]; then
|
||||||
|
_add_pkg_config_path "/opt/homebrew/lib/pkgconfig"
|
||||||
|
_add_pkg_config_path "/opt/homebrew/share/pkgconfig"
|
||||||
|
for _dir in /opt/homebrew/opt/*/lib/pkgconfig \
|
||||||
|
/opt/homebrew/opt/*/share/pkgconfig; do
|
||||||
|
_add_pkg_config_path "$_dir"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Linux (apt / rpm / LSB / manual build & install paths) and user paths
|
||||||
|
for _dir in \
|
||||||
|
"$HOME/.local/lib/pkgconfig" \
|
||||||
|
"$HOME/.local/share/pkgconfig" \
|
||||||
|
/usr/local/lib/pkgconfig \
|
||||||
|
/usr/local/lib64/pkgconfig \
|
||||||
|
/usr/local/share/pkgconfig \
|
||||||
|
/usr/lib/pkgconfig \
|
||||||
|
/usr/lib64/pkgconfig \
|
||||||
|
/usr/share/pkgconfig \
|
||||||
|
/usr/lib/*-linux-gnu*/pkgconfig \
|
||||||
|
/usr/local/lib/*-linux-gnu*/pkgconfig
|
||||||
|
do
|
||||||
|
_add_pkg_config_path "$_dir"
|
||||||
|
done
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH
|
||||||
|
}
|
||||||
|
_setup_pkgconfig
|
||||||
|
unset -f _setup_pkgconfig _add_pkg_config_path
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
# TODO: Find a way to make this automatic so pkgconfig works for anything installed via homebrew.
|
|
||||||
# See java.sh for details, but we can enumerate folders under /opt/homebrew/Cellar/*/*/lib/pkgconfig and add them all.
|
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/homebrew/Cellar/libpng/1.6.40/lib/pkgconfig
|
|
||||||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/homebrew/Cellar/zlib/1.3/lib/pkgconfig
|
|
||||||
# PKG_CONFIG_PATH=$PKG_CONFIG_PATH:
|
|
||||||
|
|
||||||
export PKG_CONFIG_PATH
|
|
||||||
104
.rc.d/ruby.sh
104
.rc.d/ruby.sh
@@ -1,6 +1,100 @@
|
|||||||
# Ruby
|
# Setup Ruby environment: version managers (rbenv, chruby, rvm), Homebrew Ruby, and gem bin paths
|
||||||
if [[ $(command -v rbenv) ]]; then
|
_setup_ruby() {
|
||||||
eval "$(rbenv init -)"
|
[ -n "$ZSH_VERSION" ] && setopt localoptions nonomatch nullglob
|
||||||
export PATH="$HOME/.gem/ruby/3.0.0/bin:$PATH"
|
|
||||||
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
|
_add_to_path() {
|
||||||
|
[ -d "$1" ] || return 0
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*) PATH="$1:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_ruby_manager_active=0
|
||||||
|
|
||||||
|
# 1. Check for rbenv (prefer managed Ruby)
|
||||||
|
if [ -d "$HOME/.rbenv/bin" ]; then
|
||||||
|
_add_to_path "$HOME/.rbenv/bin"
|
||||||
fi
|
fi
|
||||||
|
if command -v rbenv >/dev/null 2>&1; then
|
||||||
|
eval "$(rbenv init - 2>/dev/null)"
|
||||||
|
_ruby_manager_active=1
|
||||||
|
|
||||||
|
# Fast OpenSSL detection for ruby-build without calling slow `brew --prefix`
|
||||||
|
if [ -z "$RUBY_CONFIGURE_OPTS" ]; then
|
||||||
|
for _ssl_dir in \
|
||||||
|
"/opt/homebrew/opt/openssl@3" \
|
||||||
|
"/opt/homebrew/opt/openssl@1.1" \
|
||||||
|
"/usr/local/opt/openssl@3" \
|
||||||
|
"/usr/local/opt/openssl@1.1"
|
||||||
|
do
|
||||||
|
if [ -d "$_ssl_dir" ]; then
|
||||||
|
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$_ssl_dir"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. Check for chruby
|
||||||
|
if [ "$_ruby_manager_active" -eq 0 ]; then
|
||||||
|
for _chruby_sh in \
|
||||||
|
"/opt/homebrew/opt/chruby/share/chruby/chruby.sh" \
|
||||||
|
"/usr/local/share/chruby/chruby.sh" \
|
||||||
|
"/usr/share/chruby/chruby.sh"
|
||||||
|
do
|
||||||
|
if [ -r "$_chruby_sh" ]; then
|
||||||
|
\. "$_chruby_sh"
|
||||||
|
[ -r "${_chruby_sh%/*}/auto.sh" ] && \. "${_chruby_sh%/*}/auto.sh"
|
||||||
|
_ruby_manager_active=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Check for RVM
|
||||||
|
if [ "$_ruby_manager_active" -eq 0 ]; then
|
||||||
|
if [ -s "$HOME/.rvm/scripts/rvm" ]; then
|
||||||
|
\. "$HOME/.rvm/scripts/rvm"
|
||||||
|
_ruby_manager_active=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. If no version manager is active, fallback to Homebrew keg-only Ruby or standard locations
|
||||||
|
# (Avoids Apple's deprecated /usr/bin/ruby on macOS when Homebrew Ruby is installed)
|
||||||
|
if [ "$_ruby_manager_active" -eq 0 ]; then
|
||||||
|
for _brew_ruby in $(
|
||||||
|
for _r in /opt/homebrew/opt/ruby/bin \
|
||||||
|
/opt/homebrew/opt/ruby@*/bin \
|
||||||
|
/usr/local/opt/ruby/bin \
|
||||||
|
/usr/local/opt/ruby@*/bin; do
|
||||||
|
[ -x "$_r/ruby" ] && echo "$_r"
|
||||||
|
done | sort -V -r 2>/dev/null
|
||||||
|
); do
|
||||||
|
_add_to_path "$_brew_ruby"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 5. Add user gem binaries to PATH (dynamically resolved, not hardcoded to a fixed version)
|
||||||
|
if command -v ruby >/dev/null 2>&1; then
|
||||||
|
_gem_user_bin="$(ruby -e 'puts Gem.user_dir' 2>/dev/null)/bin"
|
||||||
|
if [ -n "$_gem_user_bin" ] && [ -d "$_gem_user_bin" ]; then
|
||||||
|
_add_to_path "$_gem_user_bin"
|
||||||
|
fi
|
||||||
|
unset _gem_user_bin
|
||||||
|
|
||||||
|
for _gbin in $(
|
||||||
|
for _gd in "$HOME/.gem/ruby"/*/bin "$HOME/.local/share/gem/ruby"/*/bin; do
|
||||||
|
[ -d "$_gd" ] && echo "$_gd"
|
||||||
|
done | sort -V -r 2>/dev/null
|
||||||
|
); do
|
||||||
|
_add_to_path "$_gbin"
|
||||||
|
break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset _ruby_manager_active
|
||||||
|
}
|
||||||
|
_setup_ruby
|
||||||
|
unset -f _setup_ruby _add_to_path
|
||||||
|
|||||||
75
.rc.d/rust.sh
Executable file
75
.rc.d/rust.sh
Executable file
@@ -0,0 +1,75 @@
|
|||||||
|
# Setup Rust / Cargo environment, tools, and shell completions
|
||||||
|
_setup_cargo() {
|
||||||
|
[ -n "$ZSH_VERSION" ] && setopt localoptions nonomatch nullglob
|
||||||
|
|
||||||
|
_add_to_path() {
|
||||||
|
[ -d "$1" ] || return 0
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$1:"*) ;;
|
||||||
|
*) PATH="$1:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1. Respect or detect CARGO_HOME and RUSTUP_HOME
|
||||||
|
if [ -z "$CARGO_HOME" ] && [ -d "$HOME/.cargo" ]; then
|
||||||
|
export CARGO_HOME="$HOME/.cargo"
|
||||||
|
fi
|
||||||
|
if [ -z "$RUSTUP_HOME" ] && [ -d "$HOME/.rustup" ]; then
|
||||||
|
export RUSTUP_HOME="$HOME/.rustup"
|
||||||
|
fi
|
||||||
|
|
||||||
|
_cargo_dir="${CARGO_HOME:-$HOME/.cargo}"
|
||||||
|
|
||||||
|
# 2. Source official env file if present, or add bin directory to PATH
|
||||||
|
if [ -f "$_cargo_dir/env" ]; then
|
||||||
|
\. "$_cargo_dir/env"
|
||||||
|
elif [ -d "$_cargo_dir/bin" ]; then
|
||||||
|
_add_to_path "$_cargo_dir/bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Fallback search for system or alternative Cargo/Rust locations if not in PATH
|
||||||
|
if ! command -v cargo >/dev/null 2>&1; then
|
||||||
|
for _cand in \
|
||||||
|
"/usr/local/cargo/bin" \
|
||||||
|
"/opt/homebrew/opt/rust/bin" \
|
||||||
|
"/usr/local/opt/rust/bin" \
|
||||||
|
"/opt/homebrew/bin" \
|
||||||
|
"/usr/local/bin" \
|
||||||
|
"$HOME/.local/bin"
|
||||||
|
do
|
||||||
|
if [ -x "$_cand/cargo" ]; then
|
||||||
|
_add_to_path "$_cand"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. Enable shell completions if available and files are present
|
||||||
|
if command -v cargo >/dev/null 2>&1; then
|
||||||
|
_rustup_dir="${RUSTUP_HOME:-$HOME/.rustup}"
|
||||||
|
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
for _comp in \
|
||||||
|
"$_rustup_dir"/toolchains/*/etc/bash_completion.d/cargo \
|
||||||
|
"$_rustup_dir"/toolchains/*/etc/bash_completion.d/rustup \
|
||||||
|
"/opt/homebrew/etc/bash_completion.d/cargo" \
|
||||||
|
"/usr/share/bash-completion/completions/cargo"
|
||||||
|
do
|
||||||
|
if [ -r "$_comp" ]; then
|
||||||
|
\. "$_comp"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
elif [ -n "$ZSH_VERSION" ]; then
|
||||||
|
for _zsh_comp_dir in "$_rustup_dir"/toolchains/*/share/zsh/site-functions; do
|
||||||
|
if [ -d "$_zsh_comp_dir" ]; then
|
||||||
|
case " ${fpath[*]} " in
|
||||||
|
*" $_zsh_comp_dir "*) ;;
|
||||||
|
*) fpath=("$_zsh_comp_dir" "${fpath[@]}") ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
_setup_cargo
|
||||||
|
unset -f _setup_cargo _add_to_path
|
||||||
64
.rc.d/starship.sh
Normal file
64
.rc.d/starship.sh
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# Setup starship shell integration (bash, zsh, and fallback paths)
|
||||||
|
_setup_starship() {
|
||||||
|
# Ensure starship binary is accessible if installed in common locations
|
||||||
|
if ! command -v starship >/dev/null 2>&1; then
|
||||||
|
for _starship_bin_dir in \
|
||||||
|
"/opt/homebrew/bin" \
|
||||||
|
"/usr/local/bin" \
|
||||||
|
"$HOME/.starship/bin" \
|
||||||
|
"$HOME/.local/bin"
|
||||||
|
do
|
||||||
|
if [ -x "$_starship_bin_dir/starship" ]; then
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$_starship_bin_dir:"*) ;;
|
||||||
|
*) PATH="$_starship_bin_dir:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
command -v starship >/dev/null 2>&1 || return 0
|
||||||
|
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
if starship init bash >/dev/null 2>&1; then
|
||||||
|
eval "$(starship init bash)"
|
||||||
|
else
|
||||||
|
# Fallback for older starship versions
|
||||||
|
for _dir in \
|
||||||
|
"/opt/homebrew/opt/starship/shell" \
|
||||||
|
"/usr/local/opt/starship/shell" \
|
||||||
|
"$HOME/.starship/shell" \
|
||||||
|
"/usr/share/doc/starship/examples" \
|
||||||
|
"/usr/share/starship"
|
||||||
|
do
|
||||||
|
if [ -d "$_dir" ]; then
|
||||||
|
[ -r "$_dir/completion.bash" ] && \. "$_dir/completion.bash"
|
||||||
|
[ -r "$_dir/key-bindings.bash" ] && \. "$_dir/key-bindings.bash"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
elif [ -n "$ZSH_VERSION" ]; then
|
||||||
|
if starship init zsh >/dev/null 2>&1; then
|
||||||
|
eval "$(starship init zsh)"
|
||||||
|
else
|
||||||
|
# Fallback for older starship versions
|
||||||
|
for _dir in \
|
||||||
|
"/opt/homebrew/opt/starship/shell" \
|
||||||
|
"/usr/local/opt/starship/shell" \
|
||||||
|
"$HOME/.starship/shell" \
|
||||||
|
"/usr/share/doc/starship/examples" \
|
||||||
|
"/usr/share/starship"
|
||||||
|
do
|
||||||
|
if [ -d "$_dir" ]; then
|
||||||
|
[ -r "$_dir/completion.zsh" ] && \. "$_dir/completion.zsh"
|
||||||
|
[ -r "$_dir/key-bindings.zsh" ] && \. "$_dir/key-bindings.zsh"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
_setup_starship
|
||||||
|
unset -f _setup_starship
|
||||||
55
.rc.d/yt-dlp.sh
Normal file
55
.rc.d/yt-dlp.sh
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Define yt-dlp functions with dynamic JavaScript runtime (Node.js) detection
|
||||||
|
yt-dlp() {
|
||||||
|
local _cmd="yt-dlp"
|
||||||
|
if ! command -v yt-dlp >/dev/null 2>&1; then
|
||||||
|
if [ -x "/opt/homebrew/bin/yt-dlp" ]; then
|
||||||
|
_cmd="/opt/homebrew/bin/yt-dlp"
|
||||||
|
elif [ -x "/usr/local/bin/yt-dlp" ]; then
|
||||||
|
_cmd="/usr/local/bin/yt-dlp"
|
||||||
|
elif [ -x "$HOME/.local/bin/yt-dlp" ]; then
|
||||||
|
_cmd="$HOME/.local/bin/yt-dlp"
|
||||||
|
else
|
||||||
|
echo "yt-dlp: command not found" >&2
|
||||||
|
return 127
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v node >/dev/null 2>&1; then
|
||||||
|
command $_cmd --js-runtimes "node:$(command -v node)" "$@"
|
||||||
|
else
|
||||||
|
command $_cmd "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
yt-dlp-best() {
|
||||||
|
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
yt-dlp-audio-meta() {
|
||||||
|
yt-dlp \
|
||||||
|
-f "ba[ext=m4a]/ba" \
|
||||||
|
-x --audio-format m4a \
|
||||||
|
--embed-metadata --embed-thumbnail \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
yt-dlp-formats() {
|
||||||
|
yt-dlp -F "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
yt-dlp-playlist-audio() {
|
||||||
|
yt-dlp \
|
||||||
|
--yes-playlist \
|
||||||
|
--embed-metadata --embed-thumbnail \
|
||||||
|
-f "ba[ext=m4a]/ba" \
|
||||||
|
-o "%(playlist_title,playlist_id)s/%(playlist_index)03d - %(title)s.%(ext)s" \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
yt-dlp-playlist() {
|
||||||
|
yt-dlp \
|
||||||
|
--yes-playlist \
|
||||||
|
--embed-metadata --embed-thumbnail \
|
||||||
|
-o "%(playlist_title,playlist_id)s/%(playlist_index)03d - %(title)s.%(ext)s" \
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
@@ -1,12 +1,36 @@
|
|||||||
# TODO: Check if zoxide_path exists.
|
# Setup zoxide (smarter cd command) for interactive shells (bash and zsh)
|
||||||
# TODO: Check shell better.
|
_setup_zoxide() {
|
||||||
# -n $zoxide_path -a -n $zoxide_path
|
# Only run in interactive shells
|
||||||
function anon() {
|
case $- in
|
||||||
zoxide_path=$(which zoxide)
|
*i*) ;;
|
||||||
if [ -n $zoxide_path -a $zoxide_path != "zoxide not found" ]; then
|
*) return 0 ;;
|
||||||
if [ "$SHELL" = "/bin/zsh" ]; then
|
esac
|
||||||
eval "$(zoxide init --cmd cd zsh)"
|
|
||||||
|
# Ensure zoxide binary is accessible if installed in common locations
|
||||||
|
if ! command -v zoxide >/dev/null 2>&1; then
|
||||||
|
for _zoxide_bin_dir in \
|
||||||
|
"/opt/homebrew/bin" \
|
||||||
|
"/usr/local/bin" \
|
||||||
|
"$HOME/.local/bin" \
|
||||||
|
"$HOME/bin"
|
||||||
|
do
|
||||||
|
if [ -x "$_zoxide_bin_dir/zoxide" ]; then
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$_zoxide_bin_dir:"*) ;;
|
||||||
|
*) PATH="$_zoxide_bin_dir:$PATH"; export PATH ;;
|
||||||
|
esac
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
command -v zoxide >/dev/null 2>&1 || return 0
|
||||||
|
|
||||||
|
if [ -n "$ZSH_VERSION" ]; then
|
||||||
|
eval "$(zoxide init --cmd cd zsh)"
|
||||||
|
elif [ -n "$BASH_VERSION" ]; then
|
||||||
|
eval "$(zoxide init --cmd cd bash)"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
unset -f anon
|
_setup_zoxide
|
||||||
|
unset -f _setup_zoxide
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
if type brew &>/dev/null; then
|
|
||||||
fpath=( $(brew --prefix)/share/zsh-completions "${fpath[@]}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If you receive "zsh compinit: insecure directories" warnings when attempting
|
|
||||||
# to load these completions, you may need to run these commands:
|
|
||||||
# chmod go-w '/opt/homebrew/share'
|
|
||||||
# chmod -R go-w '/opt/homebrew/share/zsh'
|
|
||||||
|
|
||||||
# compinit will load and run after this in .zshrc
|
|
||||||
70
.rc.d/zz-completions.sh
Normal file
70
.rc.d/zz-completions.sh
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# Setup shell completions for Bash and Zsh
|
||||||
|
# Named with 'zz-' prefix to guarantee late execution after all PATH and tool
|
||||||
|
# additions in ~/.rc.d/*.sh have completed.
|
||||||
|
|
||||||
|
_setup_completions() {
|
||||||
|
# Only initialize completions for interactive shells
|
||||||
|
case $- in
|
||||||
|
*i*) ;;
|
||||||
|
*) return 0 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------
|
||||||
|
# ZSH Autocompletion Setup
|
||||||
|
# -------------------------------------------------------------------------
|
||||||
|
if [ -n "$ZSH_VERSION" ]; then
|
||||||
|
# Candidate completion directories
|
||||||
|
for _dir in \
|
||||||
|
"/opt/homebrew/share/zsh-completions" \
|
||||||
|
"/usr/local/share/zsh-completions" \
|
||||||
|
"/usr/share/zsh-completions" \
|
||||||
|
"/opt/homebrew/share/zsh/site-functions" \
|
||||||
|
"/usr/local/share/zsh/site-functions" \
|
||||||
|
"$HOME/.zsh_functions"
|
||||||
|
do
|
||||||
|
if [ -d "$_dir" ]; then
|
||||||
|
case " ${fpath[*]} " in
|
||||||
|
*" $_dir "*) ;;
|
||||||
|
*) fpath=("$_dir" "${fpath[@]}") ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# If you receive "zsh compinit: insecure directories" warnings, run:
|
||||||
|
# chmod go-w '/opt/homebrew/share'
|
||||||
|
# chmod -R go-w '/opt/homebrew/share/zsh'
|
||||||
|
|
||||||
|
# Initialize compinit with 24-hour cache check for fast startup (~2ms)
|
||||||
|
autoload -Uz compinit
|
||||||
|
_zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
|
||||||
|
if [ -n "$(find "$_zcompdump" -mtime -1 2>/dev/null)" ]; then
|
||||||
|
compinit -C -d "$_zcompdump"
|
||||||
|
else
|
||||||
|
compinit -d "$_zcompdump"
|
||||||
|
fi
|
||||||
|
unset _zcompdump _dir
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------
|
||||||
|
# Bash Autocompletion Setup
|
||||||
|
# -------------------------------------------------------------------------
|
||||||
|
elif [ -n "$BASH_VERSION" ]; then
|
||||||
|
if ! shopt -oq posix; then
|
||||||
|
for _comp in \
|
||||||
|
"/opt/homebrew/etc/profile.d/bash_completion.sh" \
|
||||||
|
"/usr/local/etc/profile.d/bash_completion.sh" \
|
||||||
|
"/usr/share/bash-completion/bash_completion" \
|
||||||
|
"/etc/bash_completion" \
|
||||||
|
"$HOME/.local/share/bash-completion/bash_completion"
|
||||||
|
do
|
||||||
|
if [ -r "$_comp" ]; then
|
||||||
|
\. "$_comp"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset _comp
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
_setup_completions
|
||||||
|
unset -f _setup_completions
|
||||||
|
|
||||||
22
.tmux.conf
Normal file
22
.tmux.conf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Ensure 24-bit TrueColor pass-through
|
||||||
|
set -g default-terminal "tmux-256color"
|
||||||
|
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||||
|
set -g mouse on
|
||||||
|
|
||||||
|
# Powerline Status Bar Styling
|
||||||
|
set -g status-interval 2
|
||||||
|
set -g status-justify left
|
||||||
|
set -g status-style "bg=#1e1e2e,fg=#cdd6f4"
|
||||||
|
|
||||||
|
# Left Status (Session Name with Powerline solid cap)
|
||||||
|
set -g status-left-length 40
|
||||||
|
set -g status-left "#[bg=#89b4fa,fg=#11111b,bold] #S #[bg=#1e1e2e,fg=#89b4fa,nobold] "
|
||||||
|
|
||||||
|
# Window Tab Styling
|
||||||
|
set -g window-status-format "#[fg=#6c7086]#I: #W #[fg=#45475a]"
|
||||||
|
set -g window-status-current-format "#[bg=#fab387,fg=#11111b,bold] #I: #W #[bg=#1e1e2e,fg=#fab387,nobold]"
|
||||||
|
|
||||||
|
# Right Status (Host and Time with inverted Powerline wedges)
|
||||||
|
set -g status-right-length 80
|
||||||
|
set -g status-right "#[fg=#313244]#[bg=#313244,fg=#cdd6f4] %Y-%m-%d %H:%M #[fg=#a6e3a1]#[bg=#a6e3a1,fg=#11111b,bold] #h "
|
||||||
|
|
||||||
2
.yarnrc
2
.yarnrc
@@ -2,4 +2,4 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
lastUpdateCheck 1768790207834
|
lastUpdateCheck 1726638947230
|
||||||
|
|||||||
20
.zprofile
20
.zprofile
@@ -14,21 +14,5 @@
|
|||||||
# ~/.zlogin
|
# ~/.zlogin
|
||||||
##fi
|
##fi
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
# Hermes Agent — ensure ~/.local/bin is on PATH
|
||||||
if [ -d "$HOME/bin" ] ; then
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
PATH="$HOME/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
|
||||||
if [ -d "$HOME/.local/bin" ] ; then
|
|
||||||
PATH="$HOME/.local/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## ZSH version of this
|
|
||||||
# # if running bash
|
|
||||||
# if [ -n "$BASH_VERSION" ]; then
|
|
||||||
# # include .bashrc if it exists
|
|
||||||
# if [ -f "$HOME/.bashrc" ]; then
|
|
||||||
# . "$HOME/.bashrc"
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
|
|||||||
48
.zshrc
48
.zshrc
@@ -1,4 +1,30 @@
|
|||||||
# Consider moving these to a script in .rc.d if they don't need to be before the other scripts in there.
|
# Consider moving these to a script in .rc.d if they don't need to be before the other scripts in there.
|
||||||
|
# If Apple Silicon Homebrew is installed activate it.
|
||||||
|
if [ -x "/usr/local/homebrew/bin/brew" ]; then
|
||||||
|
eval "$(/usr/local/homebrew/bin/brew shellenv)"
|
||||||
|
# If x86_64 Homebrew is installed alias it to brew86.
|
||||||
|
if [ -x "/opt/homebrew/bin/brew" ]; then
|
||||||
|
alias brew86='arch -x86_64 /usr/local/homebrew/bin/brew'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# If x86_64 Homebrew is installed activate it.
|
||||||
|
if [ -x "/opt/homebrew/bin/brew" ]; then
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
|
# If Apple Silicon Homebrew is installed alias it to brewarm.
|
||||||
|
if [ -x "/usr/local/homebrew/bin/brew" ]; then
|
||||||
|
alias brewarm='arch -arm64 /opt/homebrew/bin/brew'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/bin" ] ; then
|
||||||
|
PATH="$HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
if [ -d "$HOME/.local/bin" ] ; then
|
||||||
|
PATH="$HOME/.local/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
# Activate ZSH autocompletion.
|
# Activate ZSH autocompletion.
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
@@ -17,30 +43,16 @@ fpath=( ~/.zsh_functions "${fpath[@]}" )
|
|||||||
setopt HIST_IGNORE_SPACE
|
setopt HIST_IGNORE_SPACE
|
||||||
setopt HIST_IGNORE_DUPS
|
setopt HIST_IGNORE_DUPS
|
||||||
setopt INC_APPEND_HISTORY
|
setopt INC_APPEND_HISTORY
|
||||||
setopt histignorealldups sharehistory
|
|
||||||
HISTSIZE=1000
|
HISTSIZE=1000
|
||||||
SAVEHIST=10000
|
SAVEHIST=10000
|
||||||
|
|
||||||
# TODO: Look for an equivalent for `shopt -s checkwinsize`
|
# TODO: Look for an equivalent for `shopt -s checkwinsize`
|
||||||
# I don't even remember what it does, but I think it's bash specific.
|
# I don't even remember what it does, but I think it's bash specific.
|
||||||
|
|
||||||
# zstyle ':completion:*' auto-description 'specify: %d'
|
# Added by cua-driver-rs installer — see https://github.com/trycua/cua
|
||||||
# zstyle ':completion:*' completer _expand _complete _correct _approximate
|
export PATH="/Users/tom/.local/bin:$PATH"
|
||||||
# zstyle ':completion:*' format 'Completing %d'
|
|
||||||
# zstyle ':completion:*' group-name ''
|
|
||||||
# zstyle ':completion:*' menu select=2
|
|
||||||
# eval "$(dircolors -b)"
|
|
||||||
# zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
|
||||||
# zstyle ':completion:*' list-colors ''
|
|
||||||
# zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
|
||||||
# zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
|
|
||||||
# zstyle ':completion:*' menu select=long
|
|
||||||
# zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
|
||||||
# zstyle ':completion:*' use-compctl false
|
|
||||||
# zstyle ':completion:*' verbose true
|
|
||||||
|
|
||||||
# zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
# Added by cua-driver-rs installer — see https://github.com/trycua/cua
|
||||||
# zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
export PATH="/Users/tom/.local/bin:$PATH"
|
||||||
|
|
||||||
# Initialize profile environment
|
|
||||||
[ -f "$HOME/.init_profile" ] && . "$HOME/.init_profile"
|
[ -f "$HOME/.init_profile" ] && . "$HOME/.init_profile"
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ INSTALL_FILES=(
|
|||||||
".rc.d"
|
".rc.d"
|
||||||
".yarnrc"
|
".yarnrc"
|
||||||
".zsh_functions"
|
".zsh_functions"
|
||||||
|
".tmux.conf"
|
||||||
|
".config/starship.toml"
|
||||||
)
|
)
|
||||||
|
|
||||||
IMPORT_FILES=(
|
IMPORT_FILES=(
|
||||||
|
|||||||
Reference in New Issue
Block a user