Configuration

HTPC Launcher requires configuration before use. It looks first for a file called . htpc-launcher.conf in the user’s home directory, then for /etc/htpc-launcher.conf. If none of those can be found the program exits immediately.

The configuration file must be formatted according to the rules for the python Config Parser module. It consists of sections denoted by headers in square brackets ([]) which contain a series of name/value pairs for each configuration item.

For example:

[startup]
launch = KEY_YELLOW

[KEY_YELLOW]
process = xbmc
search = xbmc.bin

[KEY_BLUE]
process = steam
search = .local/share/Steam/.+/steam$
needsKill = true

These are the available sections:

  • startup – global configuration for HTPC Launcher
  • log – options for the log file
  • key – options for a single application bound to an LIRC key code

Global Configuration

The following options are recognized in the startup section.

launch
The name of an LIRC key code to activate when HTPC Launcher starts. This must match one of the configured key sections.

Log Configuration

These options control how the HTPC Launcher log file behaves.

path
The path to the application log file, including file name. If not given, the log file will be created in the user’s home directory and will be called . htpc-launcher.log.

Key Configuration

Key sections describe an application that HTPC Launcher will be responsible for running. The section name must match an LIRC key code (see Find LIRC Key Codes for help finding the key codes for your remote). Within each section the following configuration items are recognized.

process
The process to run when this LIRC key is received.
search
When HTPC Launcher needs to stop an application it searches for the appropriate process using this perl-compatible regular expression.
needsKill
Set this option to true if the application does not shutdown correctly in response to a SIGTERM signal. This will cause HTPC Launcher to stop the application by sending it SIGKILL instead.

Tips For Creating the Configuration

Find LIRC Key Codes

Run the irw command to see the key names as interpretted by LIRC.

For example, this is output of irw after pressing the “1” key on a typical remote control:

$ irw
000000037ff07bfe 00 KEY_1 mceusb
000000037ff07bfe 01 KEY_1 mceusb