Unix/Linux Go Back    

UNIX for Beginners Questions & Answers If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Capture power button press on MacOs High Sierra?

UNIX for Beginners Questions & Answers


Thread Tools Search this Thread Display Modes
Old Unix and Linux 10-12-2017   -   Original Discussion by xedge
xedge's Unix or Linux Image
xedge xedge is offline
Registered User
Join Date: Oct 2017
Last Activity: 12 October 2017, 5:05 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Capture power button press on MacOs High Sierra?

Hello everyone!

I'm developing a MacOs Application in python and I'm having some issues trying to find information related to the power button pressed event. I know that in Ubuntu 14.04 you can find information about it on the acpi folders, but I realized that here in Mac that process is supposedly managed by powerd, I was looking thru the dmesg and console logs looking for something that changes when a restart is done automatically or if the computer couldn't restart itself and had to be powered on by the button.

Let me explain a little more.

In the application, I have a config file where I keep record of how many restarts have been done on the Mac by another application developed by Apple called RestartX. When it hits 10 restarts it will stop with an automation script on Sikuli. The thing is that when the test fails, the computer MUST be turned on by the user, and the RestartX app doesn't record if the test fails as it registers that operation as a Restart (which adds 1 to the app restart counter) and not as a PowerOn event.

If someone with more programming experience could tell me where to catch this kind of events apart from dmesg or how to tell which event in dmesg is related to powerEvents I will be very grateful.
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
This must be the dumbest question ever posted -T5140 power button joboy Solaris 3 04-07-2015 12:19 PM
AIX 7.1 on Power 750 is very slow with no high memory or process consumption aLuViAn AIX 6 03-04-2014 01:41 PM
to know about press button command doctor001 UNIX for Dummies Questions & Answers 1 04-02-2008 03:46 PM
Capture an empty key press... jagannatha UNIX for Dummies Questions & Answers 3 11-06-2003 09:06 PM

All times are GMT -4. The time now is 05:39 AM.