zsh updates
This commit is contained in:
@@ -62,7 +62,8 @@ stow agents bash dolphin ghostty git kde-themes konsole mangohud nvim python vim
|
|||||||
|
|
||||||
| Script | Purpose |
|
| Script | Purpose |
|
||||||
|--------|---------|
|
|--------|---------|
|
||||||
| `arch/update.sh` | Update uv, pacman, and flatpak |
|
| `arch/update.sh` | Update uv, pacman, flatpak, and VS Code (`/opt/vscode`) |
|
||||||
|
| `arch/upgrade_vscode.sh` | Upgrade `/opt/vscode` tarball install when a newer release is available |
|
||||||
| `arch/fix_vscode.sh` | Create VS Code desktop entry and icon symlinks for `/opt/vscode` |
|
| `arch/fix_vscode.sh` | Create VS Code desktop entry and icon symlinks for `/opt/vscode` |
|
||||||
| `dolphin.sh` | Copy live Dolphin config into the repo and `stow dolphin` |
|
| `dolphin.sh` | Copy live Dolphin config into the repo and `stow dolphin` |
|
||||||
| `vscode-server/install-vscode-extensions.sh` | Install extensions from `extensions.txt` (local, remote, or both) |
|
| `vscode-server/install-vscode-extensions.sh` | Install extensions from `extensions.txt` (local, remote, or both) |
|
||||||
|
|||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
|
step() {
|
||||||
|
echo
|
||||||
|
echo "==> $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
step "uv"
|
||||||
|
uv self update
|
||||||
|
|
||||||
|
step "pacman"
|
||||||
|
sudo pacman -Syu
|
||||||
|
|
||||||
|
step "flatpak"
|
||||||
|
sudo flatpak update -y
|
||||||
|
|
||||||
|
step "vscode"
|
||||||
|
"${SCRIPT_DIR}/upgrade_vscode.sh"
|
||||||
Executable
+74
@@ -0,0 +1,74 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
VSCODE_DIR=/opt/vscode
|
||||||
|
PRODUCT_JSON="${VSCODE_DIR}/resources/app/product.json"
|
||||||
|
RELEASES_API='https://update.code.visualstudio.com/api/releases/stable'
|
||||||
|
|
||||||
|
installed_version() {
|
||||||
|
if [[ ! -f "${PRODUCT_JSON}" ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
python3 -c "import json; print(json.load(open('${PRODUCT_JSON}'))['version'])"
|
||||||
|
}
|
||||||
|
|
||||||
|
latest_version() {
|
||||||
|
curl -fsSL "${RELEASES_API}" | python3 -c 'import json, sys; print(json.load(sys.stdin)[0])'
|
||||||
|
}
|
||||||
|
|
||||||
|
vscode_arch() {
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64) echo linux-x64 ;;
|
||||||
|
aarch64) echo linux-arm64 ;;
|
||||||
|
*)
|
||||||
|
echo "unsupported architecture: $(uname -m)" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
needs_upgrade() {
|
||||||
|
local installed="$1" latest="$2"
|
||||||
|
|
||||||
|
[[ -z "${installed}" ]] && return 0
|
||||||
|
[[ "${installed}" == "${latest}" ]] && return 1
|
||||||
|
[[ "$(printf '%s\n' "${installed}" "${latest}" | sort -V | head -n1)" == "${installed}" ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
installed="$(installed_version || true)"
|
||||||
|
latest="$(latest_version)"
|
||||||
|
|
||||||
|
if ! needs_upgrade "${installed}" "${latest}"; then
|
||||||
|
if [[ -z "${installed}" ]]; then
|
||||||
|
echo "VS Code is not installed at ${VSCODE_DIR}"
|
||||||
|
else
|
||||||
|
echo "VS Code ${installed} is up to date"
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Upgrading VS Code: ${installed:-not installed} -> ${latest}"
|
||||||
|
|
||||||
|
arch="$(vscode_arch)"
|
||||||
|
tmp="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "${tmp}"' EXIT
|
||||||
|
|
||||||
|
archive="${tmp}/vscode.tar.gz"
|
||||||
|
curl -fsSL "https://update.code.visualstudio.com/${latest}/${arch}/stable" -o "${archive}"
|
||||||
|
tar -xzf "${archive}" -C "${tmp}"
|
||||||
|
|
||||||
|
extract_dir="$(find "${tmp}" -maxdepth 1 -type d -name 'VSCode-linux-*' -print -quit)"
|
||||||
|
if [[ -z "${extract_dir}" ]]; then
|
||||||
|
echo "failed to find extracted VS Code directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$(dirname "${VSCODE_DIR}")"
|
||||||
|
if [[ -d "${VSCODE_DIR}" ]]; then
|
||||||
|
rm -rf "${VSCODE_DIR}.old"
|
||||||
|
mv "${VSCODE_DIR}" "${VSCODE_DIR}.old"
|
||||||
|
fi
|
||||||
|
mv "${extract_dir}" "${VSCODE_DIR}"
|
||||||
|
rm -rf "${VSCODE_DIR}.old"
|
||||||
|
|
||||||
|
echo "VS Code upgraded to ${latest}"
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
[core]
|
[core]
|
||||||
excludesfile = /home/anoto/.gitignore_global
|
excludesfile = /home/anoto/.gitignore_global
|
||||||
editor = code --wait
|
editor = code --wait
|
||||||
|
symlinks = true
|
||||||
# pager = code --wait -
|
# pager = code --wait -
|
||||||
[diff]
|
[diff]
|
||||||
tool = vscode
|
tool = vscode
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[Appearance]
|
||||||
|
ColorScheme=catppuccin-mocha
|
||||||
|
|
||||||
|
[General]
|
||||||
|
Command=/usr/bin/zsh
|
||||||
|
Icon=utilities-terminal-symbolic
|
||||||
|
Name=zsh
|
||||||
|
Parent=FALLBACK/
|
||||||
|
StartInCurrentSessionDir=false
|
||||||
|
TerminalColumns=128
|
||||||
|
|
||||||
|
[Keyboard]
|
||||||
|
KeyBindings=default
|
||||||
@@ -94,5 +94,5 @@
|
|||||||
"__pycache__",
|
"__pycache__",
|
||||||
".grok"
|
".grok"
|
||||||
],
|
],
|
||||||
"chat.titleBar.signIn.enabled": false,
|
"chat.titleBar.signIn.enabled": false
|
||||||
}
|
}
|
||||||
@@ -32,5 +32,8 @@ fpath=("$HOME/.grok/completions/zsh" $fpath)
|
|||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ -o interactive ]] || return
|
[[ -o interactive ]] || return
|
||||||
|
|
||||||
|
# Delete key sends ESC[3~; without this binding zsh inserts "~" literally
|
||||||
|
[[ -n ${terminfo[kdch1]} ]] && bindkey "${terminfo[kdch1]}" delete-char
|
||||||
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
@@ -11,4 +11,5 @@ zstyle ':vcs_info:git:*' stagedstr ' +'
|
|||||||
zstyle ':vcs_info:git:*' unstagedstr ' *'
|
zstyle ':vcs_info:git:*' unstagedstr ' *'
|
||||||
|
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
PROMPT='%B%F{38;5;46m}%n@%m%b%f %F{38;5;51m}%~%f%F{90m}${vcs_info_msg_0_}%f $ '
|
# Bright green user@host (matches bash git.bash)
|
||||||
|
PROMPT='%B%F{46}%n@%m%b%f %F{51}%~%f%F{90}${vcs_info_msg_0_}%f $ '
|
||||||
Reference in New Issue
Block a user