Caffeine
Package: WA2L/WinTools 1.2.08
Section: General Commands (1)
Updated: 13 May 2021
Index
Return to Main Contents
NAME
Caffeine - prevent system from hibernating, sleeping or locking
SYNOPSIS
WA2LWinTools/bin/caffeine
caffeine
[
-h
|
-i
|
-u
|
-a
|
-V
]
caffeine
[
options
]
AVAILABILITY
WA2L/WinTools
DESCRIPTION
If you have problems with your PC locking or going to sleep,
caffeine
will keep it awake. It works by simulating a keypress once every
59 seconds, so your machine thinks you're still working at the keyboard,
so won't lock the screen or activate the screensaver.
The icon of
Caffeine
is a coffee pot in the task tray.
Double-clicking the icon empties the coffee
pot (that's what the icon is) and temporarily disables the program.
Double-clicking it again refills the pot, and will keep your machine awake.
By default the app starts enabled, and works every 59 seconds.
caffeine
works by simulating an F15 key up event every 59 seconds.
Of all the key presses available, F15 is probably the least
intrusive (I've never seen a PC keyboard with that key!), and
least likely to interfere with your work.
When
caffeine
is started without options, it loads the settings defined in the
CAFFEINE_OPTIONS
from the configuration file
etc/caffeine.cfg
if present.
OPTIONS
- -h
-
usage message.
- -i
-
install the
caffeine
command to
'Startup'
in the
Windows Start Menu.
- -u
-
uninstall the
caffeine
shortcut from
'Startup'
in the
Windows Start Menu.
- -V
-
print program version.
- -a
-
start
caffeine
and load the options defined in the
CAFFEINE_AUTOSTART
setting in the
etc/caffeine.cfg
file.
- xx
-
where
xx
is a number which sets the number of seconds
between simulated keypresses. This must be the first
text on the commandline
- -startoff
-
application starts disabled.
- -exitafter:xx
-
application will terminate after xx minutes
- -activefor:xx
-
application will become inactive after
xx
minutes
- -inactivefor:xx
-
application will become active after
xx
minutes
- -appexit
-
terminates current running instance of application
- -appon
-
makes the current running instance of the application active
- -appoff
-
makes the current running instance of the application inactive
- -apptoggle
-
toggles the running state of the current running instance of the application
- -apptoggleshowdlg
-
toggles the running state, and shows dialog
- -replace
-
closes the current running instance, replacing it
- -noicon
-
does not show a task tray icon
- -useshift
-
simulate the shift key instead of F15
- -showdlg
-
shows a dialog indicating whether caffeine is active
- -stes
-
tell Windows to stay awake, don't use F15
- -ontaskbar
-
show a task bar button (use with -showdlg)
- -allowss
-
prevent sleep, but allow the screensaver to start
- -key:xx
-
simulate using virtual key code
xx
Note: the codes on the linked page are in Hex, convert them to
decimal for use with this parameter.
See:
https://docs.microsoft.com/de-ch/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN
for virtual key codes.
- -keypress
-
simulate a full key press, not just a key up event
- -oldicons
-
use more colourful tray icons
- -lighticons
-
always use the light icons
- -darkicons
-
always use the dark icons
- -watchwindow:xx
-
active only when a window with xx in the title is found
- -activehours:........xxxxxxxx........
-
put 24
.
or
x
characters, which indicate from hour 0 to hour 23 of the day.
caffeine
will be active only in hours with an
x.
- -onac
-
active only when the computer is on AC power (plugged in)
ENVIRONMENT
-
EXIT STATUS
- 0
-
always.
- 4
-
usage message displayed.
- 5
-
version message displayed.
FILES
- etc/caffeine.cfg
-
optional configuration file for
caffeine.
EXAMPLES
-
SEE ALSO
wintoolsintro(1),
caffeine.cfg(4),
config(1m),
nosleep(1),
http://www.zhornsoftware.co.uk/caffeine/,
https://docs.microsoft.com/de-ch/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN
NOTES
Parts of this manpage were extracted from the documentation of
caffeine
written by Tom Revell and modified to fit to the WA2L/WinTools package.
See:
http://www.zhornsoftware.co.uk/caffeine/
for more information.
BUGS
While using
putty(1)
you should deactivate
caffeine
or use the
-stes
or
-useshift
option to start
caffeine
to avoid receiving control characters within the
putty
session.
On some systems you might receive the following error message:
-
WA2LWinTools\lib\caffeine.exe
The application has failed to start because its side-by-side
configuration is incorrect. Please see the application event
log or use the command-line sxstrace.exe tool for more detail.
Fix:
-
Download and install the 'Microsoft Visual C++ 2008 Redistributable
Package (x86)' from:
https://www.microsoft.com/en-us/download/details.aspx?id=29
For more information see:
http://www.zhornsoftware.co.uk/support/kb.pl?q=00085.
AUTHOR
caffeine was developed by Tom Revell and
integrated into WA2L/WinTools by Christian Walther. Send suggestions
and bug reports related to the integration to wa2l@users.sourceforge.net .
COPYRIGHT
Copyright © 2021
Christian Walther
This is free software; see
WA2LWinTools/man/COPYING
for copying conditions. There is ABSOLUTELY NO WARRANTY; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This document was created by man2html
using the manual pages.
Time: 16:31:48 GMT, September 14, 2024