Ce contenu n'est pas disponible dans la langue sélectionnée.
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:
/usr/bin/redhat-kiosk
#!/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 "$@"
Important
The/usr/bin/redhat-kiosk
file must be executable.Replace thegedit ~/.local/bin/redhat-kiosk
code 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 [...]
/usr/share/applications/com.redhat.Kiosk.Script.desktop
[Desktop Entry] Name=Kiosk Type=Application Exec=redhat-kiosk
/usr/share/applications/com.redhat.Kiosk.WindowManager.desktop
[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
/usr/share/gnome-session/sessions/redhat-kiosk.session
[GNOME Session] Name=Kiosk RequiredComponents=com.redhat.Kiosk.WindowManager;com.redhat.Kiosk.Script;
/usr/share/xsessions/com.redhat.Kiosk.desktop
[Desktop Entry] Name=Kiosk Comment=Kiosk mode Exec=/usr/bin/gnome-session --session=redhat-kiosk DesktopNames=Red-Hat-Kiosk;GNOME;
- Restart the
GDM
service:systemctl restart gdm.service
- Create a separate user for the kiosk session and select
Kiosk
as the session type for the user of the kiosk session.Figure 13.1. Selecting the kiosk session
By starting the
Kiosk
session, the user launches a full screen application designed for the kiosk deployment.