This configuration script transforms a Debian 12 machine into a passive kiosk mode. The kiosk mode is designed to automatically launch Chromium in fullscreen mode, displaying a specified webpage (https://yourwebpage.com) when the computer starts, without requiring user login. This mode is ideal for showcasing dashboards, presentations, or static web pages on a display.
- Automatic Kiosk Startup: Chromium opens in kiosk mode and displays the page
https://yourwebpage.comas soon as the system boots up. - Monitoring and Refreshing: A watchdog script checks every 30 minutes whether Chromium is running. If necessary, it restarts Chromium or refreshes the current page.
- Keyboard Shortcut to Exit Kiosk: A keyboard shortcut (
Ctrl + Alt + Delete) allows the user to stop the kiosk mode, providing access to the login window or desktop environment.
- Debian 12: Ensure you are running Debian 12 or a compatible distribution.
- XFCE Desktop Environment: Ensure you have the XFCE desktop environment installed on your Debian 12 system.
- Internet Connection: The script requires an internet connection to install necessary packages and to access the specified webpage.
The script automatically installs the following packages if they are not already installed:
chromium: The web browser used in kiosk mode.xdotool: A tool to simulate keyboard input and mouse activity.xmlstarlet: A command-line XML toolkit used to modify XFCE keyboard shortcuts.
-
Download the Script: Save the script as
setup_kiosk.sh. -
Make the Script Executable:
chmod +x setup_kiosk.sh
-
Run the Script with Superuser Privileges:
sudo ./setup_kiosk.sh
-
Reboot Your Computer: After executing the script, restart your computer to apply the changes.
- Install Dependencies: The script updates the package list and installs Chromium,
xdotool, andxmlstarlet. - Create Kiosk Launch Script: It creates a script to launch Chromium in kiosk mode with the specified URL.
- Set Up Systemd Service: A systemd service is created to ensure Chromium starts automatically at boot.
- Create Watchdog Script: A script is set up to monitor the running state of Chromium and refresh or restart it as needed.
- Add Cron Job: A cron job is added to run the watchdog script every 30 minutes.
- Configure XFCE Keyboard Shortcut: The script automatically configures a keyboard shortcut to stop the kiosk service, allowing easy access to the system.
The kiosk mode configuration script performs several actions on your Debian 12 system to set up a kiosk environment effectively. Here’s a detailed breakdown of each change made by the script, along with instructions on how to modify parameters post-installation if your needs change.
-
Installation of Dependencies:
- Packages Installed:
- Chromium: The browser used to display the specified webpage in kiosk mode.
- xdotool: A utility that simulates keyboard input and mouse actions, used to refresh the webpage.
- xmlstarlet: A command-line tool for parsing and editing XML, utilized to manage keyboard shortcuts.
- How to Change: If you need a different browser (e.g., Firefox), you can manually install it later and modify the kiosk launch script path.
- Packages Installed:
-
Creation of the Kiosk Launch Script:
- File Path: The script is created at
/usr/local/bin/kiosk.sh. - Content: The script contains commands to launch Chromium in kiosk mode with the specified URL.
- How to Change:
- To update the URL displayed, edit the
kiosk.shfile:sudo nano /usr/local/bin/kiosk.sh
- Change the URL in the line:
/usr/bin/chromium --noerrdialogs --disable-infobars --kiosk "https://yourwebpage.com" - Save and exit (CTRL + X, then Y, then Enter).
- To update the URL displayed, edit the
- File Path: The script is created at
-
Systemd Service Creation:
- Service File Path: A systemd service file is created at
/etc/systemd/system/kiosk.service. - Functionality: This service manages the kiosk mode, ensuring Chromium starts automatically on boot.
- How to Change:
- If you want to modify the service parameters (like environment variables), edit the service file:
sudo nano /etc/systemd/system/kiosk.service
- After making changes, remember to reload the systemd configuration:
sudo systemctl daemon-reload
- You can restart the service using:
sudo systemctl restart kiosk.service
- If you want to modify the service parameters (like environment variables), edit the service file:
- Service File Path: A systemd service file is created at
-
Creation of the Watchdog Script:
- File Path: The watchdog script is created at
$HOME/chromium_cron_watchdog.sh. - Functionality: This script checks if Chromium is running every 30 minutes and refreshes or restarts it if necessary.
- How to Change:
- You can adjust the interval for the cron job. Open the crontab:
crontab -e
- Change the line that runs the watchdog script to adjust the frequency (e.g.,
*/15 * * * *for every 15 minutes).
- You can adjust the interval for the cron job. Open the crontab:
- File Path: The watchdog script is created at
-
Cron Job Addition:
- Job Schedule: The script adds a cron job that executes the watchdog script every 30 minutes.
- How to Change:
- You can modify this schedule in the crontab as mentioned above. To remove the job, delete the corresponding line in the crontab.
-
XFCE Keyboard Shortcut Configuration:
- File Path: The keyboard shortcut configuration is saved in
$HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml. - Functionality: The shortcut
Ctrl + Alt + Deleteis set to stop the kiosk service. - How to Change:
- To add or modify keyboard shortcuts, you can use the XFCE GUI by navigating to:
- Settings > Keyboard > Application Shortcuts.
- Alternatively, you can directly edit the XML file:
nano "$HOME/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml"
- To add or modify keyboard shortcuts, you can use the XFCE GUI by navigating to:
- File Path: The keyboard shortcut configuration is saved in
If your requirements change after installing the script, here are some common adjustments you might want to make:
-
Changing the Displayed URL: Edit the kiosk launch script as described above to point to a new URL.
-
Modifying the Refresh Interval: Update the cron job frequency in the crontab.
-
Adding New Keyboard Shortcuts: Use the XFCE GUI or modify the XML file directly to add or change shortcuts.
-
Changing Browser Settings: If you switch browsers, update the kiosk launch script with the new browser path and options.
-
Stopping/Starting the Kiosk Mode: You can stop the kiosk service anytime using:
sudo systemctl stop kiosk.service
To start it again:
sudo systemctl start kiosk.service