Linux Unbuntu 12.04 Unity Greeter -- can a remote work??
#1
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:

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

And X.org sees the remote:

Code:
#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

However, I can't press up and down, or the all important enter to log in. As the Xbva build for my ATI seems to lose hdmi sound often, I have to quit xbmc, go into the server room, press enter, and then come back. It would be awesome to be able to have IR remote control at the unity greeter. Any ideas or suggestions?
Reply
#2
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
Quote: 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:
Quote:#!/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
Reply
#3
Thanks for sharing this, I have a similar setup (Ubuntu 12.04 with a regular user login, XBMC user with XBMC as shell and MythTV user with Mythfrontend as shell). Unity Greeter seems ideal for this compared to all other greeters I tried, due to being navigatable with Up/Down/OK and remembering session type per user.

I've never delved into LIRC configuration, since XBMC always worked out of the box on both Ubuntu and OpenELEC, so never came across the greeter issue, but it was inconvenient having to dig out of the keyboard whenever I had gone out of XBMC.

Your config and script work perfectly. I just saved it as /etc/lirc/lirc.greeter.conf and added it to /etc/lirc/lircrc as an include. I was scratching my head for a while, as I was getting permission denied errors but eventually realised I'd forgotten to chmod +x the script.
Reply

Logout Mark Read Team Forum Stats Members Help
Unbuntu 12.04 Unity Greeter -- can a remote work??0