بنقرة واحدة
night-duty
Use when someone says 'night duty', 'caffeinate', or 'blind'. Keeps Mac awake or dims screen to zero.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when someone says 'night duty', 'caffeinate', or 'blind'. Keeps Mac awake or dims screen to zero.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | night-duty |
| description | Use when someone says 'night duty', 'caffeinate', or 'blind'. Keeps Mac awake or dims screen to zero. |
Mac utility skill with three modes:
Determine mode from the user's message:
Run this bash command in the background:
caffeinate -dis &
CAFFEINE_PID=$!
echo $CAFFEINE_PID > /tmp/caffeinate.pid
# Start hourly watcher (no --wait-blind since this is caffeinate-only)
nohup /Users/sarthak/Claude/.claude/scripts/night-duty/watcher.sh > /dev/null 2>&1 &
echo $! > /tmp/night-duty-watcher.pid
echo "Caffeinate running (PID: $CAFFEINE_PID). Hourly reminders active."
Use run_in_background: true on the Bash tool so it doesn't block.
Tell the user:
Two-step process: dim now, restore when user says "restore".
Step 1 — Dim screen:
osascript -e '
tell application "System Events"
repeat 50 times
key code 145
delay 0.03
end repeat
end tell' && touch /tmp/night-duty-blind && echo "Screen dimmed to zero."
Tell the user: "Screen dimmed. Dim your keyboard manually (F5 key). Say 'restore' when you want brightness back."
Step 2 — Restore (when user says "restore", "unblind", or "lights on"):
osascript -e '
tell application "System Events"
repeat 8 times
key code 144
delay 0.05
end repeat
end tell' && rm -f /tmp/night-duty-blind && echo "Brightness restored to ~50%."
Ask the user: "Night duty activated. What do you need?"
Then execute the chosen mode(s). If both:
caffeinate -dis &
CAFFEINE_PID=$!
echo $CAFFEINE_PID > /tmp/caffeinate.pid
touch /tmp/night-duty-blind
# Start watcher in --wait-blind mode (waits for keypress restore before counting hours)
nohup /Users/sarthak/Claude/.claude/scripts/night-duty/watcher.sh --wait-blind > /dev/null 2>&1 &
echo $! > /tmp/night-duty-watcher.pid
echo "Caffeinate running (PID: $CAFFEINE_PID). Hourly reminders start after screen restores."
rm -f /tmp/night-duty-blind in the restore step signals the watcher to start counting).If the user says "stop caffeinate", "kill caffeinate", or "stop night duty":
kill $(cat /tmp/caffeinate.pid) 2>/dev/null && rm -f /tmp/caffeinate.pid
kill $(cat /tmp/night-duty-watcher.pid) 2>/dev/null && rm -f /tmp/night-duty-watcher.pid
rm -f /tmp/night-duty-blind
echo "Night duty fully stopped."