diff -Nru acpi-support-0.138/debian/changelog acpi-support-0.138/debian/changelog --- acpi-support-0.138/debian/changelog 2010-11-21 20:18:59.000000000 -0500 +++ acpi-support-0.138/debian/changelog 2012-04-03 12:06:59.000000000 -0400 @@ -1,3 +1,13 @@ +acpi-support (0.138-ubuntu1) oneiric; urgency=low + + * Added lenovo-touchpad2 from precise acpi-support-0.140 which supports + newer thinkpads that are in the certification process. + + * Backported power-funcs from precise acpi-support-0.140 which works + around iLP: #933626 and LP: #870297. + + -- Ayan George Tue, 03 Apr 2012 11:45:09 -0400 + acpi-support (0.138) natty; urgency=low * drop sony-* event handlers, which are also now superseded by a kernel diff -Nru acpi-support-0.138/events/lenovo-touchpad2 acpi-support-0.138/events/lenovo-touchpad2 --- acpi-support-0.138/events/lenovo-touchpad2 1969-12-31 19:00:00.000000000 -0500 +++ acpi-support-0.138/events/lenovo-touchpad2 2012-04-03 11:42:45.000000000 -0400 @@ -0,0 +1,6 @@ +# /etc/acpi/events/lenovo-touchpad2 +# This is called when the user presses Fn-F8 on newer Lenovo ThinkPads, +# toggling the touchpad on and off. + +event=ibm/hotkey HKEY 00000080 000060a +action=/etc/acpi/asus-touchpad.sh diff -Nru acpi-support-0.138/lib/power-funcs acpi-support-0.138/lib/power-funcs --- acpi-support-0.138/lib/power-funcs 2010-06-10 17:21:53.000000000 -0400 +++ acpi-support-0.138/lib/power-funcs 2012-04-03 11:43:14.000000000 -0400 @@ -5,24 +5,44 @@ PATH="$PATH:/usr/bin/X11" POWERSTATE="/var/lib/acpi-support/powerstate" +# getXuser: get the user for the specified X display, or if none is +# specified, then the user for whatever X display we find. +# input: $displaynum: the X display to query +# output: $XAUTHORITY: the path to the xauth data used for connecting to the +# detected X display. +# $user: the username of the user who owns the display. getXuser() { - user=$(who | awk "/:$displaynum)/ { print \$1; exit }") - - if [ x"$user" = x"" ]; then - user=$(who | awk "/:$displaynum/ { print \$1; exit }") + local display userhome uid + if [ -z "$displaynum" ]; then + display=.+ + else + display=":$displaynum" fi - if [ x"$user" != x"" ]; then - userhome=`getent passwd $user | cut -d: -f6` + uid=$(ck-list-sessions | awk 'BEGIN { unix_user = ""; } /^Session/ { unix_user = ""; } /unix-user =/ { gsub(/'\''/,"",$3); unix_user = $3; } /x11-display = '\'$display\''/ { print unix_user; exit (0); }') + + if [ -n "$uid" ]; then + user=$(getent passwd $uid | cut -d: -f1) + userhome=$(getent passwd $user | cut -d: -f6) export XAUTHORITY=$userhome/.Xauthority else + user= export XAUTHORITY="" fi } +# getXconsole: get the information for the active X console, if any. +# calls getXuser to get information related to the logged-in user. +# input: none +# output: $XAUTHORITY: the path to the xauth data used for connecting to the +# detected X display. +# $DISPLAY: the X display +# $user: the username of the user who owns the display. getXconsole() { - console=`fgconsole`; - displaynum=`ps t tty$console | sed -n -re 's,.*/X .*:([0-9]+).*,\1,p'` - if [ x"$displaynum" != x"" ]; then + local displaynum + + displaynum=$(ck-list-sessions | awk 'BEGIN { active = 0; } /^Session/ { active = 0; } /active = TRUE/ { active = 1; } active && /x11-display = '\':.+\''/ { gsub(/'\':*'/,"",$3); print $3; exit (0); }') + + if [ -n "$displaynum" ]; then export DISPLAY=":$displaynum" getXuser fi