HACKER Q&A
📣 steviey19

Turn Key Ubuntu Kiosk Mode


I’m building a home brew hardware device on the Ubuntu platform. There are 3-4 specific binaries loaded on to the device, and the user will at times need to be running one of them at a time.

Since I want the product to have a console feel, I’d like to boot directly into some sort of kiosk or app launcher, that would only allow the user to select from one of these preset binaries.

At the moment, I care less about actual security of the system (user breaking out of the sandbox), and more about ease of use and UX.

I’ve searched the web for an easy solution to this, but everything I’ve found seems like a lot of configuration and set up. I’ve also looked briefly into some of the game emulator Linux builds, but modifying these feels like overkill. I know some configuration will be necessary, but was hoping the community may be able to help me save some cycles with a few suggested applications or methods to achieve this!

I should also mention I’m open to both paid and free software options.

Any ideas?


  👤 jzombie Accepted Answer ✓
I don't know... this?

#!/bin/bash

while true; do echo "Please choose a binary to run:" echo "1) Binary 1" echo "2) Binary 2" echo "3) Binary 3" echo "4) Binary 4" echo "5) Exit"

    read -p "Enter choice: " choice

    case $choice in
        1) 
            /path/to/binary1
            ;;
        2)
            /path/to/binary2
            ;;
        3)
            /path/to/binary3
            ;;
        4)
            /path/to/binary4
            ;;
        5)
            echo "Exiting."
            exit 0
            ;;
        *)
            echo "Invalid choice, please try again."
            ;;
    esac
done

=======

To use this script:

1. Copy the script into a file on your device. You might name it launcher.sh, for example.

2. Make the script executable by running chmod +x launcher.sh.

3. Set this script as the login shell for your user. To do this, you'll need to add the full path to the script to /etc/shells, and then use chsh -s /full/path/to/launcher.sh username to change the login shell for username.

4. Configure your system to automatically log in as username. The method for doing this depends on which display manager you're using. If you're using LightDM, for example, you can do this by editing /etc/lightdm/lightdm.conf.

When you boot the device, it should automatically log in as username and present the menu defined in the script.