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

  1. 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 the gedit ~/.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;
      
  2. Restart the GDM service:
    systemctl restart gdm.service
  3. Create a separate user for the kiosk session and select Kiosk as the session type for the user of the kiosk session.
    Selecting 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.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.