-
Notifications
You must be signed in to change notification settings - Fork 63
/
zzz.8
106 lines (106 loc) · 2.05 KB
/
zzz.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.Dd July 25, 2014
.Dt ZZZ 8
.Os Linux
.Sh NAME
.Nm zzz ,
.Nm ZZZ
.Nd suspend or hibernate your computer
.Sh SYNOPSIS
.Nm zzz
.Op Fl nSzZRH
.Nm ZZZ
.Op Fl nSzZRH
.Sh DESCRIPTION
.Nm
is a simple script to suspend or hibernate your computer.
It supports hooks before and after suspending.
.Bl -tag -width indent
.It Fl n
dry-run mode.
Instead of performing an ACPI action,
.Nm
will just sleep for a few seconds.
.It Fl S
Enter low-power idle mode (ACPI S1, kernel name "freeze").
.It Fl z
Enter suspend to RAM mode (ACPI S3, kernel name "mem").
This is the default for
.Nm zzz .
.It Fl Z
Enter hibernate to disk mode (ACPI S4, kernel name "disk") and power off.
This is the default for
.Nm ZZZ .
.It Fl R
Enter hibernate to disk mode and reboot.
This can be used to switch operating systems.
.It Fl H
Enter hibernate to disk mode and suspend.
This is also know as suspend-hybrid.
.El
.Sh FILES
Before suspending,
.Nm zzz
runs the executable files in
.Pa /etc/zzz.d/suspend
in alphanumeric order.
After suspending,
.Nm zzz
runs the executable files in
.Pa /etc/zzz.d/resume
in alphanumeric order (not in reverse order!).
.Pp
The environment variable
.Ev ZZZ_MODE
can be used in these hooks to differentiate between
.Ic standby ,
.Ic suspend ,
.Ic resume ,
and
.Ic hibernate .
If the value is
.Ic hibernate ,
then
.Ev
ZZZ_HIBERNATE_MODE
can be used to differentiate between
.Ic platform ,
.Ic reboot ,
and
.Ic suspend
hibernation modes.
.Sh DIAGNOSTICS
.Bl -tag -width indent
.It suspend/hibernate not supported
The hardware does not support ACPI S3/S4 with this kernel.
.It sleep permission denied
You lack sufficent privilege to write to
.Pa /sys/power/state .
.It another instance of zzz is running
.Nm
locks
.Pa /sys/power
during operation.
Perhaps a hook is stuck?
.It Zzzz... yawn.
The system has woken up again.
Everything is fine.
You feel refreshed.
.Sh SEE ALSO
.Xr pm-action 8 ,
.Xr s2disk 8 ,
.Xr s2ram 8 ,
OpenBSD's
.Xr apm 8
.Sh HISTORY
A similar
.Nm apm
command appeared in
.Nx 1.3
and
.Ox 1.2 .
.Sh AUTHOR
.An Leah Neukirchen ,
.Mt [email protected] .
.Sh LICENSE
.Nm
is in the public domain.