chore: clean up dotfiles and add gitignore whitelist

Switch to whitelist-based .gitignore to only track essential configs:
nvim, yazi, kitty, zsh, ideavim, karabiner, tmux, scripts, starship.
Remove history, compiled files, and plugin dirs from tracking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Naderer
2026-03-11 12:57:14 +01:00
parent 61b1e3d2a9
commit d8a20d620a
32 changed files with 1471 additions and 2868 deletions

36
scripts/start-kanata.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# Kanata Startup Script
# Starts Kanata with proper configuration and logging
KANATA_CONFIG="$HOME/Library/Application Support/kanata/kanata.kbd"
LOG_FILE="$HOME/Library/Logs/kanata.log"
# Create log directory if it doesn't exist
mkdir -p "$(dirname "$LOG_FILE")"
# Check if kanata is already running
if pgrep -x "kanata" > /dev/null; then
echo "$(date): Kanata is already running" >> "$LOG_FILE"
exit 0
fi
# Check if config file exists
if [ ! -f "$KANATA_CONFIG" ]; then
echo "$(date): ERROR - Kanata config file not found: $KANATA_CONFIG" >> "$LOG_FILE"
exit 1
fi
# Start Kanata
echo "$(date): Starting Kanata with config: $KANATA_CONFIG" >> "$LOG_FILE"
# Run kanata in the background with logging
/opt/homebrew/bin/kanata -c "$KANATA_CONFIG" >> "$LOG_FILE" 2>&1 &
# Get the PID
KANATA_PID=$!
# Save PID for easier management
echo "$KANATA_PID" > "$HOME/.kanata.pid"
echo "$(date): Kanata started with PID: $KANATA_PID" >> "$LOG_FILE"

32
scripts/stop-kanata.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Kanata Stop Script
# Stops Kanata process gracefully
LOG_FILE="$HOME/Library/Logs/kanata.log"
PID_FILE="$HOME/.kanata.pid"
# Check if PID file exists
if [ -f "$PID_FILE" ]; then
KANATA_PID=$(cat "$PID_FILE")
# Check if process is running
if ps -p "$KANATA_PID" > /dev/null 2>&1; then
echo "$(date): Stopping Kanata (PID: $KANATA_PID)" >> "$LOG_FILE"
sudo kill "$KANATA_PID"
rm -f "$PID_FILE"
echo "$(date): Kanata stopped" >> "$LOG_FILE"
else
echo "$(date): Kanata process not found (PID: $KANATA_PID)" >> "$LOG_FILE"
rm -f "$PID_FILE"
fi
else
# Try to kill any running kanata process
if pgrep -x "kanata" > /dev/null; then
echo "$(date): Killing all Kanata processes" >> "$LOG_FILE"
sudo pkill kanata
echo "$(date): Kanata processes killed" >> "$LOG_FILE"
else
echo "$(date): No Kanata processes found" >> "$LOG_FILE"
fi
fi

View File

@@ -1,20 +1,47 @@
#!/bin/zsh
set -euo pipefail
# Auto-remount TN shares when network changes.
# Credentials should be stored in macOS Keychain (connect once via Finder, remember password).
# User Configuration
USER="AK127132" # Insert Your AK Number
PASSWORD="enzfcj4bhg!mwr8BUH" # Insert your password
SERVER="140.78.8.107"
SHARE1="TNGROUP/tn-group/ipec"
SHARE2="TNHOME/home/AK127132"
# Mount TNGROUP
echo "Mounting TNGROUP..."
osascript -e "try" -e "mount volume \"smb://$USER:$PASSWORD@$SERVER/$SHARE1\"" -e "end try"
# Use URL-encoded path segments for spaces if needed.
SHARE1_URL="smb://$SERVER/TNGROUP/tn-group/ipec"
SHARE2_URL="smb://$SERVER/TNHOME/home/AK127132"
# Mount TNHOME
echo "Mounting TNHOME..."
osascript -e "try" -e "mount volume \"smb://$USER:$PASSWORD@$SERVER/$SHARE2\"" -e "end try"
# Expected mount points under /Volumes (adjust if your Finder mount names differ)
MOUNT1="/Volumes/ipec"
MOUNT2="/Volumes/AK127132"
echo "Mounting complete."
log() {
echo "[tnmount] $*"
}
is_mounted() {
local mountpoint="$1"
mount | grep -q " on ${mountpoint} "
}
mount_if_missing() {
local mountpoint="$1"
local url="$2"
if is_mounted "$mountpoint"; then
log "Already mounted: $mountpoint"
else
log "Mounting: $url"
open "$url"
fi
}
# Skip when server is unreachable (offsite/no VPN), try again on next interval.
if ! nc -zw2 "$SERVER" 445 >/dev/null 2>&1; then
log "Server $SERVER:445 not reachable; skipping"
exit 0
fi
mount_if_missing "$MOUNT1" "$SHARE1_URL"
mount_if_missing "$MOUNT2" "$SHARE2_URL"
log "Done"