You are not logged in.

#1 2016-04-25 08:36:09

aktentasche
Member
Registered: 2016-04-25
Posts: 4

Docking station: how to catch _SB_ event from the kernel

Hi all!

so I have been fiddling with the /etc/acpi/handler.sh:

ibm/hotkey)
case "$2" in
	LEN0068:00)
		case "$3" in
			00000080)
				case "$4" in
					00006030)
						logger "start kodi"
						export DISPLAY=:0.0
						sudo -u MYUSERNAME kodi
						;;  
					00004011)					
						logger "kill kodi"
						sudo -u MYUSERNAME kill -s INT $(pgrep kodi)
						;;							
				esac
				;;					
		esac
		;;											    				
esac
;;

As you see I want to start "kodi" on a dock and kill it on an undock. I have two issues:

1. The dock event that I am checking for appears also on an undock:

DOCK

battery PNP0C0A:00 00000080 00000001
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000001
ibm/hotkey LEN0068:00 00000080 00006030 <--
thermal_zone LNXTHERM:00 00000081 00000000

UNDOCK

battery PNP0C0A:00 00000080 00000001
battery PNP0C0A:00 00000080 00000001
ibm/hotkey LEN0068:00 00000080 00004011
ac_adapter ACPI0003:00 00000080 00000000
ibm/hotkey LEN0068:00 00000080 00006030   <--
thermal_zone LNXTHERM:00 00000081 00000000

Probably some bouncing connection or something.

However, journalctl -f shows following (southbridge?) event:

kernel: ACPI: \_SB_.GDCK: undocking
and
kernel: ACPI: \_SB_.GDCK: docking

I do not see those events in handler.sh (which should be handling all events, i.e. "anything"). This site suggests that there is a corresponding folder but I cannot find it.

So How do I run kodi by catching the above events?

2. kodi isn't killed when

sudo -u x230 kill -s INT $(pgrep kodi)

is executed (tested it with another acpi event, a button press). What am I doing wrong? This might be a newbie question but I am kind of new to Linux ^^ From my terminal it works. I am running KDE5.

Cheers,
aktentasche

Offline

Board footer

Powered by FluxBB