13.9. Single-application Mode
Single-application mode is a modified shell which reconfigures the shell into an interactive kiosk. The administrator locks down some behavior to make the standard desktop more restrictive for the user, letting them focus on selected features.
Set up single-application mode for a wide range of functions in a number of fields (from communication to entertainment or education) and use it as a self-serve machine, event manager, registration point, etc.
Procedure 13.9. Set Up Single-application Mode
- Create the following files with the following content:
#!/bin/sh if [ ! -e ~/.local/bin/redhat-kiosk ]; then mkdir -p ~/.local/bin ~/.config cat > ~/.local/bin/redhat-kiosk << EOF #!/bin/sh # This script is located in ~/.local/bin. # It's provided as an example script to show how # the kiosk session works. At the moment, the script # just starts a text editor open to itself, but it # should get customized to instead start a full screen # application designed for the kiosk deployment. # The "while true" bit just makes sure the application gets # restarted if it dies for whatever reason. while true; do gedit ~/.local/bin/redhat-kiosk done EOF chmod +x ~/.local/bin/redhat-kiosk touch ~/.config/gnome-initial-setup-done fi exec ~/.local/bin/redhat-kiosk "$@"
/usr/bin/redhat-kioskfile must be executable.Replace the
gedit ~/.local/bin/redhat-kioskcode by the commands that you want to execute in the kiosk session. This example launches a full-screen application designed for the kiosk deployment named http://mine-kios-web-app:
[...] while true; do firefox --kiosk http://mine-kios-web-app done [...]
[Desktop Entry] Name=Kiosk Type=Application Exec=redhat-kiosk
[Desktop Entry] Type=Application Name=Mutter Comment=Window manager Exec=/usr/bin/mutter Categories=GNOME;GTK;Core; OnlyShowIn=GNOME; NoDisplay=true X-GNOME-Autostart-Phase=DisplayServer X-GNOME-Provides=windowmanager; X-GNOME-Autostart-Notify=true X-GNOME-AutoRestart=false X-GNOME-HiddenUnderSystemd=true
[GNOME Session] Name=Kiosk RequiredComponents=com.redhat.Kiosk.WindowManager;com.redhat.Kiosk.Script;
[Desktop Entry] Name=Kiosk Comment=Kiosk mode Exec=/usr/bin/gnome-session --session=redhat-kiosk DesktopNames=Red-Hat-Kiosk;GNOME;
- Restart the
systemctl restart gdm.service
- Create a separate user for the kiosk session and select
Kioskas the session type for the user of the kiosk session.
Figure 13.1. Selecting the kiosk session
By starting the
Kiosksession, the user launches a full screen application designed for the kiosk deployment.