View Single Post
Posts: 255 | Thanked: 61 times | Joined on Feb 2010
#20
Code:
#!/bin/sh

if [ `hal-get-property --udi /org/freedesktop/Hal/devices/platform_kb_lock --key button.state.value` == true  ] ; then
#  echo press >> /tmp/kllp
#  date >> /tmp/kllp
  echo $$ > /tmp/kb_lock_long_pid
  sleep 2
 if [ -f /tmp/kb_lock_long_pid ] ; then
   rm -f /tmp/kb_lock_long_pid
#   echo long >> /tmp/kllp
#   date >> /tmp/kllp
#   run-standalone.sh env >> /tmp/kllp
   if true ; then
    if dbus-send --print-reply --system --dest=com.nokia.mce --type=method_call /com/nokia/mce/request com.nokia.mce.request.get_device_mode | grep -q normal ; then
     echo 1 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts
    else
     echo 0 > /sys/devices/platform/omap2_mcspi.1/spi1.0/disable_ts
    fi
   fi
 fi
else
 if [ -f /tmp/kb_lock_long_pid ] ; then
  kill `cat /tmp/kb_lock_long_pid`
  rm -f /tmp/kb_lock_long_pid
#  echo del >> /tmp/kllp
#  date >> /tmp/kllp
 fi
fi &
hows that look? Thats my modification of longpress, other than the fact it needs to be ran with root privileges it should work. I would install longpress then edit /usr/bin/longpress.sh and cut/paste my script and see if it works.

I cant test this because of pr1.2 (dbus-scripts missing) and im leaving for work soon so let me know what happens.

Last edited by ear0wax; 2010-05-27 at 23:46.
 

The Following User Says Thank You to ear0wax For This Useful Post: