Files
clearpilot/system/clearpilot/nice-monitor.sh
Brian Hanson 698a1647a0 nightrider mode improvements, nice monitor, ready text 1x
- Nightrider: lines 1px wider (3px outline), engagement border hidden,
  planner lines hidden when disengaged, stay on onroad view in park
- Normal mode only: return to ready splash on park
- Ready text sprite at native 1x size
- Nice monitor: keeps claude processes at nice 19, runs every 30s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 23:24:37 -05:00

20 lines
543 B
Bash
Executable File

#!/usr/bin/bash
# Nice monitor — ensures claude processes run at lowest CPU priority.
# Checks every 30 seconds and renices any claude process not already at nice 19.
# Kill other instances of this script
for pid in $(pgrep -f 'nice-monitor.sh' | grep -v $$); do
kill "$pid" 2>/dev/null
done
while true; do
for pid in $(pgrep -f 'claude' 2>/dev/null); do
cur=$(awk '{print $19}' /proc/$pid/stat 2>/dev/null)
if [ -n "$cur" ] && [ "$cur" != "19" ]; then
renice 19 -p "$pid" > /dev/null 2>&1
fi
done
sleep 30
done