Skip to content

Conversation

@frytaz
Copy link

@frytaz frytaz commented Feb 19, 2014

10.9+

@arjun024
Copy link
Owner

Hi frytaz. Thanks for this. In this issue (#1), there's some code that's suggested. I don't work on a mac to test :|. Could you check that too and give me some comments.

@frytaz
Copy link
Author

frytaz commented Feb 19, 2014

import subprocess
        subprocess.call('echo \'tell application "Finder" to sleep\' | osascript', shell=True)

#1 works also, just needed to adjust it to use escaped single apostrophes, also will work on osx older than 10.9

@arjun024
Copy link
Owner

Does pmset displaysleepnow work only on 10.9+ and not on older systems?

@frytaz
Copy link
Author

frytaz commented Feb 19, 2014

Yes it was added in 10.9

pmset displaysleepnow is available only on 10.9+
To compile:
```
gcc -v -framework CoreFoundation -framework IOKIT -o turnoff_darwin
turnoff_darwin.c
```
@arjun024
Copy link
Owner

Actually i intent on keeping this Python only

@arjun024 arjun024 mentioned this pull request Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants