mirror of
https://github.com/ION606/config-backup.git
synced 2026-05-14 22:16:58 +00:00
added claude
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
temp/
|
temp/
|
||||||
props.txt
|
props.txt
|
||||||
|
*.log
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
log_dir="${HOME}/.claude/logs"
|
||||||
|
mkdir -p "$log_dir"
|
||||||
|
|
||||||
|
timestamp="$(date +%Y%m%d-%H%M%S)"
|
||||||
|
session_file="${log_dir}/session-${timestamp}.log"
|
||||||
|
cwd="$(pwd)"
|
||||||
|
|
||||||
|
echo "session: ${session_file}"
|
||||||
|
|
||||||
|
if [[ -z "${CLAUDE_CODE_OAUTH_TOKEN:-}" ]]; then
|
||||||
|
CLAUDE_CODE_OAUTH_TOKEN="$(pass show claude/oauth-token | tr -d '\n')" || {
|
||||||
|
echo "error: could not retrieve token from pass" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${ANTHROPIC_API_KEY:-}" ]]; then
|
||||||
|
echo "error: ANTHROPIC_API_KEY would override oauth, billing API instead of plan" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# build minimal claude.json with subscription binding only
|
||||||
|
auth_blob="$(
|
||||||
|
python3 <<PY
|
||||||
|
import json
|
||||||
|
d = json.load(open("${HOME}/.claude.json"))
|
||||||
|
out = {
|
||||||
|
"hasCompletedOnboarding": True,
|
||||||
|
"theme": "dark",
|
||||||
|
"bypassPermissionsModeAccepted": True,
|
||||||
|
"userID": d.get("userID", ""),
|
||||||
|
"oauthAccount": d.get("oauthAccount", {}),
|
||||||
|
"projects": {
|
||||||
|
"/workspace": {
|
||||||
|
"hasTrustDialogAccepted": True,
|
||||||
|
"hasTrustDialogHooksAccepted": True,
|
||||||
|
"hasCompletedProjectOnboarding": True,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
print(json.dumps(out))
|
||||||
|
PY
|
||||||
|
)"
|
||||||
|
|
||||||
|
if [[ -z "$(echo "$auth_blob" | python3 -c 'import sys,json; print(json.load(sys.stdin).get("userID",""))')" ]]; then
|
||||||
|
echo "error: no userID found in host ~/.claude.json -- log in on host first" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export CLAUDE_CODE_OAUTH_TOKEN
|
||||||
|
export AUTH_BLOB="$auth_blob"
|
||||||
|
|
||||||
|
docker pull containers.ion606.dev/ion606/claude-docker:latest &>/dev/null
|
||||||
|
|
||||||
|
docker run --rm -it \
|
||||||
|
-v "${cwd}:/workspace" \
|
||||||
|
-e CLAUDE_CODE_OAUTH_TOKEN \
|
||||||
|
-e AUTH_BLOB \
|
||||||
|
-e README_CONTENTS="$(cat ${cwd}/CLAUDE.md)" \
|
||||||
|
--cap-drop ALL \
|
||||||
|
ion-claude:latest "$@" \
|
||||||
|
2>&1 | tee "$session_file"
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
PACKAGE_FILE="packages.txt"
|
||||||
|
LOG_FILE="broken_packages.log"
|
||||||
|
|
||||||
|
# Check if packages.txt exists
|
||||||
|
if [[ ! -f "$PACKAGE_FILE" ]]; then
|
||||||
|
echo "Error: $PACKAGE_FILE not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clear or create the log file
|
||||||
|
echo "--- Installation Failures ($(date)) ---" > "$LOG_FILE"
|
||||||
|
|
||||||
|
echo "Starting installation process..."
|
||||||
|
|
||||||
|
# Loop through each line in the file
|
||||||
|
while IFS= read -r package || [[ -n "$package" ]]; do
|
||||||
|
# Skip empty lines or lines starting with #
|
||||||
|
[[ -z "$package" || "$package" =~ ^# ]] && continue
|
||||||
|
|
||||||
|
echo "Installing: $package..."
|
||||||
|
|
||||||
|
# Attempt installation
|
||||||
|
if ! yay -Sy --noconfirm "$package"; then
|
||||||
|
echo "[FAILED] $package" | tee -a "$LOG_FILE"
|
||||||
|
else
|
||||||
|
echo "[SUCCESS] $package"
|
||||||
|
fi
|
||||||
|
|
||||||
|
done < "$PACKAGE_FILE"
|
||||||
|
|
||||||
|
echo "--------------------------------------"
|
||||||
|
echo "Process complete. Broken packages logged in $LOG_FILE"
|
||||||
@@ -88,7 +88,7 @@ mkdir -p /home/$USERTEMP/auto-cpufreq/auto-cpufreq.conf
|
|||||||
mv auto-cpufreq.conf /home/$USERTEMP/auto-cpufreq/auto-cpufreq.conf
|
mv auto-cpufreq.conf /home/$USERTEMP/auto-cpufreq/auto-cpufreq.conf
|
||||||
|
|
||||||
# set up automations in child process
|
# set up automations in child process
|
||||||
mkdir -p /home/$USERTEMP/.automations && cp -r -f auto/* /home/$USERTEMP/.automations/ && $(sudo pacman -Sy --needed --noconfirm dunst && sudo bash /home/$USERTEMP/.automations/setupauto.sh /home/$USERTEMP &> /home/$USERTEMP/setuplogs.log) &
|
mkdir -p /home/$USERTEMP/.automations && cp -r -f auto/* /home/$USERTEMP/.automations/ && $(sudo pacman -Sy --needed --noconfirm dunst && sudo bash /home/$USERTEMP/.automations/setupauto.sh /home/$USERTEMP &>/home/$USERTEMP/setuplogs.log) &
|
||||||
|
|
||||||
# Installs
|
# Installs
|
||||||
# Librewolf
|
# Librewolf
|
||||||
@@ -114,11 +114,12 @@ sudo systemctl enable lemurs.service
|
|||||||
sudo mv -f lemurs-config.toml /etc/lemurs/config.toml
|
sudo mv -f lemurs-config.toml /etc/lemurs/config.toml
|
||||||
|
|
||||||
mv -f Librewolf/chrome /home/$USERTEMP/.librewolf/
|
mv -f Librewolf/chrome /home/$USERTEMP/.librewolf/
|
||||||
|
mv -f claude /usr/sbin/
|
||||||
|
|
||||||
npm install -g @bitwarden/cli alacritty-themes typescript || echo "failed to install Typescript!"
|
npm install -g @bitwarden/cli alacritty-themes typescript || echo "failed to install Typescript!"
|
||||||
|
|
||||||
mkdir -p /home/$USERTEMP/.icons
|
mkdir -p /home/$USERTEMP/.icons
|
||||||
echo -e "https://www.gnome-look.org/p/1305251\nhttps://www.gnome-look.org/p/2091068" > /home/$USERTEMP/.icons/links.txt
|
echo -e "https://www.gnome-look.org/p/1305251\nhttps://www.gnome-look.org/p/2091068" >/home/$USERTEMP/.icons/links.txt
|
||||||
|
|
||||||
alacritty-themes --create && alacritty-themes Hyper || echo "alacritty theme install failed!"
|
alacritty-themes --create && alacritty-themes Hyper || echo "alacritty theme install failed!"
|
||||||
cp -r /home/$USERTEMP/.config/wofi/ wofi >/dev/null 2>&1 &
|
cp -r /home/$USERTEMP/.config/wofi/ wofi >/dev/null 2>&1 &
|
||||||
|
|||||||
Reference in New Issue
Block a user