ZZZ(8)

πŸ“¦
version 0.2.0 Β· 3 versions
, in alpine 3.24

πŸ’€ ZZZ(8) πŸ’€ β€” zzz, ZZZ: suspend or hibernate your computer 🫢

✨ NAME ✨

zzz, ZZZ β€” suspend or hibernate your computer. No cap, that’s the whole mission. πŸ’…

🌸 SYNOPSIS 🌸

zzz [-v] [-n|s|S|z|Z|H|X|R|V|h]
ZZZ [-v] [-n|s|S|z|Z|H|X|R|V|h]

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so zzz is a simple program to suspend or hibernate your computer. It supports hooks before and after suspending. Like, it handles the sleepy-time vibes and lets your hook scripts do their little routines around it. ✨

πŸ’– OPTIONS πŸ’–

  • -n β€” Dry-run mode. Instead of performing an ACPI action, zzz will just sleep for a few seconds. Pretend nap era, lowkey iconic. 😴
  • -s, -S β€” Enter low-power idle mode (ACPI S1, kernel name freeze). Chill mode activated. 🧊
  • -z β€” Enter suspend to RAM mode (ACPI S3, kernel name mem). This is the default for zzz. 🫢
  • -Z β€” Enter hibernate to disk mode (ACPI S4, kernel name disk) and power off. This is the default for ZZZ. πŸ’€
  • -H β€” Enter hibernate to disk mode and suspend. This is also known as suspend-hybrid. Hybrid queen behavior. πŸ‘‘
  • -X β€” Enter hibernate to disk mode and shutdown. This can be used when ACPI S4 mode causes issues. Emergency vibe check. 🚨
  • -R β€” Enter hibernate to disk mode and reboot. This can be used to switch operating systems. Reboot era. πŸ”
  • -v β€” Be verbose. Give me all the lore. πŸ—£οΈ
  • -V β€” Print program name & version and exit. Little identity check. πŸͺͺ
  • -h β€” Print help message and exit. Help bestie out. πŸ†˜

πŸŽ€ FILES πŸŽ€

  • /etc/zzz.d/* β€” Hook scripts found in this directory are executed before/after the system is suspended/resumed by zzz. ✨
  • /etc/zzz.d/suspend/* β€” Hook scripts found in this directory are executed before the system is suspended by zzz. This directory is supported for compatibility with zzz(8) on Void Linux. 🐧
  • /etc/zzz.d/resume/* β€” Hook scripts found in this directory are executed after the system is resumed. This directory is supported for compatibility with zzz(8) on Void Linux. 🐧

The hook script is a regular file (or a symlink) owned by root, executable by the owner and not writeable by others. Any other files found in the aforesaid directories are ignored. Rules are rules, bestie. 🫑

The hook scripts are executed sequentially in alphabetic order with two arguments:

  1. β€œpre” (before suspend), or β€œpost” (after resume),
  2. the same as ZZZ_MODE (see below).

And the following environment variables:

  • ZZZ_MODE β€” The selected suspend mode; one of β€œhibernate”, β€œnoop”, β€œstandby”, or β€œsuspend”.
  • ZZZ_HIBERNATE_MODE β€” The selected hibernate mode: β€œplatform”, β€œreboot”, β€œshutdown”, or β€œsuspend”.

🌈 EXIT CODES 🌈

  • 0 β€” Clean exit, no error has encountered. Slay. βœ…
  • 1 β€” General error. Oop. 😭
  • 10 β€” Invalid usage. Bestie, the syntax said no. πŸ’€
  • 11 β€” The requested sleep state or hibernation mode is not supported or you don’t have insufficient privileges.
  • 12 β€” Unable to obtain lock; another instance of zzz is running. One at a time, main character. πŸ”’
  • 20 β€” Failed to put system to sleep. The nap did not happen. πŸ˜”
  • 21 β€” Some hook script exited with a non-zero code. Note that zzz does not stop when a hook script fails. It keeps going, fr fr. πŸšΆβ€β™€οΈ

πŸ“ LOGGING πŸ“

Information and debug messages are printed to STDOUT, error messages are printed to STDERR. All messages are also logged to syslog with ident string zzz and facility code 1 (user). Receipts everywhere. 🧾

Debug messages are not printed and logged unless -v is specified. So if you want the deep lore, say -v. πŸ‘€

πŸ•°οΈ HISTORY πŸ•°οΈ

This program is inspired from zzz(8) script in Void Linux written by Leah Neukirchen. Respect the ancestors. 🫢

πŸ‘‘ AUTHORS πŸ‘‘

Jakub Jirutka. Icon. ✨

πŸ› REPORTING BUGS πŸ›

Report bugs to the project’s issue tracker at https://github.com/jirutka/zzz/issues. Tell them everything, bestie. 🫑


πŸŽ€ That’s the whole manual, bestie. Page date: 2024-08-15; manual: ZZZ(8). Go suspend something iconic. πŸ’…βœ¨
πŸ“¦ where this page comes from