Reuse Unwanted Infrared Remote Control to Launch Graphical Application in Raspberry Pi

Introduction

This is an extension to my instructable “Shutting down and Restarting” Raspberry Pi using a remote control unit. This time, I want to launch graphical (GUI) applications such a a terminal emulator and a browser in addition to shutting down and restarting the RPI. A browser is a GUI application which means that init scripts which was used in the “Shutting down and Restarting” instructable cannot be used. Instead, we must make use of the X Session Manager of the the Desktop environment to implement our goals.Reuse Unwanted Infrared Remote Control to Launch Graphical Application in Raspberry Pi

Scope

Launch Epiphany Web Browser when I press a button on a remote control unit.

Launch LXTerminal when I press a button on a remote control unit

Shutdown RPI when I press a button on a remote control unit

Restart RPI when I press a button on a remote control unit

Audience

Anyone with Raspberry Pi and Remote Control

Step 1: Add Infrared Interface and Configure Remote Control Software

Step 2: Disable the previous lircrc configuration

Open terminial emulator in Raspberry Pi

$cd /etc/lirc
$mv lircrc lircrc.backup

Step 3: Create a new lircrc configuration file in home directory

Create a new lircrc configuration and save it as .lircrc in home directory

vim <strong>/home/pi/.lircrc</strong>

Enter the data like what is show in the screenshot.

Save the file.

Step 4: Configure X Session Manager to autostart irexec program

Now that /etc/lirc/lircrc configuration file is disabled, the LIRC daemon will not start irexec automatically.

irexec has to be started manually after every X session login. However, we can configure X Session Manager to autostart irexec.

Open terminal emulator in Raspberry Pi.

Create a file named autostart

$vi /home/pi/.config/lxsession/LXDE/autostart

Type as shown in screenshot

Save the fileReuse Unwanted Infrared Remote Control to Launch Graphical Application in Raspberry Pi schematich

Step 5: Test

Open terminal emulator in Raspberry Pi

$sudo reboot

Once the OS is loaded, press the necessary button on the remote control unit to launch the application that you specified in .lircrc file to launch.

If results are not what we expect, it's time to debug.

 

 

For more detail: Reuse Unwanted Infrared Remote Control to Launch Graphical Application in Raspberry Pi


About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation and engineering. My writing style is clear and simple, and I am skilled in using infographics and diagrams. I am a great researcher and am able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter
Scroll to Top