View Single Post
Old 04-24-2025, 08:13 AM   #1
hanginwithdaddo
Enthusiast
hanginwithdaddo doesn't litterhanginwithdaddo doesn't litter
 
hanginwithdaddo's Avatar
 
Posts: 32
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
Example from pressing the power button twice, starting with the Kindle not in screen saver mode. Note that lipc-wait-event won't display anything until it receives and event. This example was from a Kindle Signature running OS version 5.17.0.

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
I used this silly script to see if there were any events that I could catch to know if the kindle is connected to a power source and to identify events related to the kindle disconnecting from a given USB device. Hope someone finds this useful. Just another tool for our developer toolkit.
hanginwithdaddo is offline   Reply With Quote