Files
dotfiles/scripts/stop-kanata.sh
Thomas Naderer d8a20d620a 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>
2026-03-11 12:57:14 +01:00

32 lines
962 B
Bash
Executable File

#!/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