![]() |
#1 |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
How to listen for most events dispatched by a Kindle
All, you can use the script below to listen for and display most events dispatched by a given kindle OS. Just invoke it and then perform various actions, such as pressing the power button, to see the events dispatched in response to the given action based on the current state of the kindle. Press ctrl-C to exit.
Code:
#!/bin/bash # # Listen for and display most events generated by a given kindle. cd /usr/share/webkit-1.0/pillow/javascripts sources=$(grep "const .*_SOURCE = \"com\." * | sed -e 's/.*_SOURCE = "\(.*\)".*/\1/') echo "${sources}" | sort -u | lipc-wait-event -l -m "*" | while read event do echo "${event}" done Code:
[root@kindle bin]# ./eventlistener.sh Event Source: com.lab126.appmgrd Event Source: com.lab126.asr Event Source: com.lab126.audiomgrd Event Source: com.lab126.btfd Event Source: com.lab126.pillow Event Source: com.lab126.powerd Event Source: com.lab126.system Event Source: com.lab126.winmgr Waiting for events... com.lab126.powerd goingToScreenSaver 2 com.lab126.winmgr titleBarVisiblityChange "invisible" com.lab126.powerd t1TimerReset com.lab126.powerd outOfScreenSaver 1 com.lab126.winmgr titleBarVisiblityChange "visible" com.lab126.powerd exitingScreenSaver ![]() |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,497
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
|
Cool! Do you know if the script can catch when Kindle transitions from regular sleep to deep sleep?
|
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
Yes, you will see a powerd "readyToSuspend" event as it's about to go into deep sleep and a "suspending" event as it goes into deep sleep (meaning things like cron activities won't run). I'm in the process of reworking a script that I have for preventing the device from going into a deep sleep when connected to a power source which I'll post in another thread eventually. I use my kindle to control my home automation and when it's plugged in I don't want it going into a deep sleep. I also use the script to support rotating screen images every 5 minutes via cron and sounding a grandather clock sounds at appropriate times, all of which I only want running when plugged into a power source. Enjoy!
Last edited by hanginwithdaddo; 04-24-2025 at 03:01 PM. Reason: corrected typo |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() ![]() ![]() Posts: 3
Karma: 210
Join Date: Nov 2023
Device: PW5 * 2, KS 2022
|
Great! There are quite a few more event sources we can eavesdrop:
Code:
lipc-probe -l Code:
grep -sori "com\.lab126\.[a-z\.]\+" /etc /usr | cut -d ':' -f 2 | sort -u |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,497
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
|
Awesome! Thanks!
I am currently looking into an issue where KOReader’s toggle for hall effect sensor (cover magnet) doesn’t work when Kindle is in suspend. I am looking into ways to trigger the suspend manually. Do you think there is lipc-property for this? |
![]() |
![]() |
![]() |
#6 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 187
Karma: 1512344
Join Date: Jul 2023
Device: PW3, PW4 :(, KT5, PW5, KLC
|
Just to throw my two cents in
Here's a (imo) more readable nicer view of the lipc-probe https://gist.github.com/notmarek/4fd...0110c926067c88 it also has the queryable Hash properties that you dont get with normal lipc-probe, as for the events you can use dbus-monitor to monitor all the lipc traffic. |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
Just a note that properties reported by lipc-probe are *properties* that you can set and query, using lipc-set-prop and lipc-get-prop, not events that you can wait on.
Last edited by hanginwithdaddo; 04-25-2025 at 08:41 AM. Reason: corrected typo |
![]() |
![]() |
![]() |
#8 | |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
Quote:
Code:
lipc-set-prop com.lab126.powerd wakeUp 1 |
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,497
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
|
Thanks! Over on KOReader Github we found that another way out from suspend is using the magnet cover! We are trying to tame it now, so that it stays off when KOReader turns it off.
https://github.com/koreader/koreader...ent-2822591700 |
![]() |
![]() |
![]() |
#10 | |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
Quote:
Code:
lipc-set-prop suspendGrace 0 lipc-set-prop powerButton 1 |
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,497
Karma: 5000046
Join Date: Feb 2012
Location: Cape Canaveral
Device: Kindle Scribe
|
So, it will always directly go to suspend after power button?
I am also trying to prevent my favorite foot-gun situations ![]() |
![]() |
![]() |
![]() |
#12 |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
deleted.
Last edited by hanginwithdaddo; 04-25-2025 at 08:41 PM. |
![]() |
![]() |
![]() |
#13 | |
Enthusiast
![]() ![]() Posts: 27
Karma: 122
Join Date: Apr 2025
Location: Pennsylvania, USA
Device: Kindle Signature, 12th Gen.
|
Quote:
I'm just about ready to publish what I've done so others can look at it and reuse anything they find useful. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Detecting headphone events on kindle touch | inuxy | Kindle Developer's Corner | 4 | 07-15-2012 11:38 AM |
Free (Kindle) Reconstructing 3/11: Earthquake, Tsunami... [Japan Recent Events] | ATDrake | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 06-11-2012 03:54 PM |
Free Book (Kindle/Nook/Sony) - Listen | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 7 | 01-31-2011 08:18 PM |
Do you listen to music on the kindle while reading? | demoric | Amazon Kindle | 7 | 07-24-2009 10:33 AM |