0

I am using an Xenial Xerus minimal Ubuntu install.

I want a command ("antimicro") to be run on boot/login (doesn't matter) to map my Bluetooth controller buttons to keyboard keys. The farthest I could get is:

DISPLAY=":0" antimicro --hidden

Which does not work as a cron job, gdm postlogin commands or ~/.profile (gdm and Kodi not running), it seems to require a logged in terminal. It worked well when I execute it manually on tty1, it will display log and "occupies" the terminal until the application is closed.

I don't mind turning on auto login or disabling password etc. It's a HTPC running Kodi, and that's why I want it to be run automatically on each boot.

I am quite new on Linux and this may just be a stupid question, sorry if that's the case. I have tried my best to find information online.

EDIT: it's probably not a duplicate, none of the solutions worked.

1 Answers1

0

Create a script with the editor of your choice.

For my example, let's call it btmap and place it in /home/username/scripts/

Of course you would change username in the path with your actual username.

Put DISPLAY=":0" antimicro in the editor, save and close.

Open a terminal in the scripts folder where the btmap file is. Type in chmod 755 btmap to make it executable.

Now sudo su and type password in if asked.

Type in echo "/home/username/scripts/btmap" >> /etc/gdm/PostLogin/Default

This will append your Default file with the execution of btmap.

Now reboot and see if it worked.

Delorean
  • 11,563