Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there any way to get LightDM to see a MCE remote as an input device at the greeter screen? I have three accounts -- my user account, MythTV, and XBMC and I'd like to be able to switch between these using a remote. I've made the following change to my xorg.conf:

Section "InputClass"
    Identifier           "Remote"
    MatchDevicePath      "/dev/input/event2"
    Option            "Ignore" "True"
EndSection

And X.org sees the remote:

#cat /var/log/Xorg.0.log | grep Media |grep input |grep event
[354591.052] (II) config/udev: Adding input device Media Center Ed. eHome Infrared Remote Transceiver (0471:060c) (/dev/input/event2)
share|improve this question

1 Answer 1

I actually solved this through a twostep process:

  • used xdotool to simulate keyboard events.
  • used irexec to listen to specific IR events, and then fire off the script

$irexec /etc/lirc/lirc.greeter.conf

Here is lirc.greeter.conf

begin
    remote = mceusb
    button = KEY_UP
    prog   = irexec
    repeat = 0
    config = greeter_sendkey Up
end

begin
    remote = mceusb
    button = KEY_DOWN
    prog   = irexec
    repeat = 0
    config = greeter_sendkey Down 
end

begin
    remote = mceusb
    button = KEY_OK
    prog   = irexec
    repeat = 0
    config = greeter_sendkey Return
end

and the script it sends the event to:

#!/bin/bash

LOGIN=`who | grep tty7 | /usr/bin/awk '{ print $1 }'`

if [ -z "$1" ];
  then
   echo "usage: greeter_sendkey CMD"
   exit 2
fi

if [ "$LOGIN" ]; 
   then
     echo "$LOGIN is logged into console"

   else
    export XAUTHORITY=/var/run/lightdm/root/:0
    export DISPLAY=:0
    /usr/bin/xdotool key $1
fi

The who command checks to see if anyone is logged into tty7 the local graphical session. If there is no one logged in, assume the greeter is running. As the script needs to interact with the X server, it needs the xauth file. This is the xauth file for ubuntu 12.04

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.