Aller au contenu
Skillpedia
Automatisations48k · #3754

anti-sleep

Ce qu’il fait

Empêche votre Mac de se mettre automatiquement en veille pendant les tâches longues, comme les téléchargements ou les mises à jour. Il garde l'écran allumé et le système éveillé.

Quand l’utiliser

  • ✓Pendant des téléchargements ou des mises à jour longs.
  • ✓Lorsque vous lancez des programmes qui prennent beaucoup de temps.
  • ✓Lorsque vous ne voulez pas que votre Mac se mette en veille pendant une période donnée.

Lien du skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/anti-sleep/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/anti-sleep/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Garde mon Mac éveillé pendant 3 heures.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Il utilise une commande intégrée au Mac, `caffeinate`. Vous indiquez combien de temps garder le Mac éveillé, ou jusqu'à la fin d'une tâche précise.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Anti-Sleep (macOS caffeinate)

When to Use

  • Use when the user wants the Mac to stay awake during a long supervised task.
  • Use when a build, download, or automation run should not be interrupted by sleep.

Keep the Mac awake using the built-in caffeinate command. No install needed.

Quick start — the standard command

caffeinate -d -i -t 7200    # full power: screen stays on + no idle sleep, for 2 hours

Duration is -t <seconds>: 2h = 7200, 7h = 25200, overnight (9h) = 32400.

Aggressiveness levels

Flags Effect
-i prevents idle system sleep only (screen may still dim/lock)
-d prevents display sleep (screen stays on)
-d -i default choice — screen on + system awake
-d -i -s adds -s: prevents sleep even on AC power semantics; -s only works when plugged in
-u -t 1 simulates user activity — wakes the display right now

Default to -d -i -t <seconds> unless the user says otherwise.

Tie to a process instead of a timer

caffeinate -d -i -w <PID>          # stays awake until that process exits (great for builds)
caffeinate -i npm run build       # wraps a command; exits when the command finishes

Run it in a visible terminal (cmux pane)

Prefer running it in the user's own terminal pane so it's visible and easy to Ctrl+C. In cmux (read the cmux skill first if interacting with panes):

cmux send --surface surface:<N> "caffeinate -d -i -t 25200\n"

Otherwise run it as a background Bash task. Never block your own foreground shell with it.

Verify and monitor

pgrep -fl caffeinate                       # is it running? shows exact flags
ps -o etime= -p <PID>                      # how long it's been running
pmset -g assertions    # inspect PreventUserIdleSystemSleep / PreventUserIdleDisplaySleep        # confirm sleep assertions are active

Gotcha: caffeinate prints nothing and holds the prompt — it looks "stuck" or like Enter wasn't pressed. It isn't stuck. Verify with pgrep, not by looking at the terminal.

Expiry: with -t it exits silently when time runs out — no notification. If the user asks "is it still on?" after hours, check pgrep first; it may simply have expired.

Keyboard backlight

caffeinate cannot keep the keyboard backlight on — it has its own inactivity timer with no CLI/API on Apple Silicon (researched 2026-07). Fix is manual, one-time: System Settings > Keyboard > "Turn keyboard backlight off after inactivity" > Never.

Stop early

kill <recorded-caffeinate-PID>    # or Ctrl+C in the pane running this task

Record the PID of the process started for this task; verify its command before stopping it. Do not stop unrelated caffeinate sessions by a broad pattern.

After starting: confirm to the user the PID, the flags, and the wall-clock time it will expire.

Limitations

  • Adapted from davidondrej/skills; verify local paths, tools, credentials, and agent features before acting.
  • For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.
Questions fréquentes

Comment savoir si ça fonctionne ?

Vous pouvez vérifier si la commande `caffeinate` est en cours d'exécution sur votre Mac. Elle n'affiche rien à l'écran, donc on pourrait croire qu'elle ne fait rien, mais elle fonctionne bel et bien.

Comment l'arrêter avant la fin ?

Si vous avez lancé la commande, elle fournit un numéro (PID). Vous pouvez utiliser ce numéro pour arrêter le processus avant la fin du délai.

Garde-t-elle le rétroéclairage du clavier allumé ?

Non, `caffeinate` ne contrôle pas le rétroéclairage du clavier. Vous devez le régler manuellement dans les réglages de votre Mac.

Détails

Description originale de l’auteur

Keep a Mac awake with caffeinate during long builds, downloads, or supervised automation runs.

repo: sickn33/agentic-awesome-skills

Popularité

Étoiles GitHub
48k
Position au classement
#3754
Licence
MIT
Mis à jour
15/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires