<commit_before>displaysleep
============

Tiny OS X command line tool that puts all attached displays to sleep and turns
off keyboard illumination. Eventually, this will lock the computer after a
certain amount of time, which can be set in the Preferences->Security settings.
This is useful if e.g. you take your MacBook to work regularly and need a "lock"
feature like Windows' Meta+L.
Formally, this functionality was provided on all Macs with optical drives and
eject button. On laptops such as the Macbook Air or the new Retina Macbook Pro
however, the eject button is no longer available and there is no way to
call the shortcut manually or to assign it to a new shortcut. This program is
merely a call to IOKit's corresponding registry entry, setting it to boolean
value true.

Installation
============

Make sure Apple's command line tools are installed.
Build manually using: 

    gcc -Wall -o displaysleep -framework IOKit \
         -framework Foundation displaysleep.c

Copy to e.g. /usr/local/bin and make sure the location is in your PATH.

If you use Jigish's excellent tool slate, put this in your .slate configuration
to assign a keyboard shortcut to displaysleep:
    
    bind l:cmd;alt shell wait path:~/bin '/Volumes/Daten/Users/larmeh/bin/displaysleep'

This would assign displaysleep to Cmd+Alt L. Use whatever suits you by altering
the first bind parameter.

TODO
====
- Makefile including 'install' target
- Manpage<commit_msg>Added description why this workaround is now obsolete.<commit_after>displaysleep
============

Tiny OS X command line tool that puts all attached displays to sleep and turns
off keyboard illumination. This can be used to lock the computer: Use the setting
in Preferences->Security settings to specify how soon a password is required
after your computer's displays have been turned off. This is useful if e.g. you
take your MacBook to work regularly and need a "lock" feature like Windows' Meta+L.

Formerly, this functionality was provided on all Macs with optical drives because
these had an eject button on their keyboards. On laptops such as the Macbook Air
or the new Retina Macbook Pro however, the eject button is no longer available
and there is no way to call the shortcut manually or to assign it to a new
set of keys.

All this program does is issue a call to IOKit's registry, setting the corresponding
boolean value for "display sleep" to true.

UPDATE: As of spring 2013 this software is now obsolete. Apple has reassigned the
functionality from Shift+Ctrl+Eject to Shift+Ctrl+Power on all computers without
optical drive and a power key on their keyboards. However, you can still use it if
you'd like to assign a certain shortcut for some reason.

Installation
============

Make sure Apple's command line tools are installed.
Build manually using: 

    gcc -Wall -o displaysleep -framework IOKit \
         -framework Foundation displaysleep.c

Copy to e.g. /usr/local/bin and make sure the location is in your PATH.

If you use Jigish's excellent tool slate, put this in your .slate configuration
to assign a keyboard shortcut to displaysleep:
    
    bind l:cmd;alt shell wait path:~/bin '/Volumes/Daten/Users/larmeh/bin/displaysleep'

This would assign displaysleep to Cmd+Alt L. Use whatever suits you by altering
the first bind parameter.

TODO
====
- Makefile including 'install' target
- Manpage
{'fraction_non_alphanumeric': 0.057236061684460264, 'fraction_numerical': 0.0011862396204033216, 'mean_word_length': 4.189230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3536558', 'n_tokens_mistral': 899, 'n_tokens_neox': 841, 'n_words': 501}