Configurar o modo de aplicación única
Single-application mode is a modified GNOME Shell which configures the Shell as an interactive kiosk. The administrator locks down some behavior to make the standard desktop more restrictive for users, 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, and so on.
Your distribution might provide the GNOME Kiosk session, which is usually available in the gnome-kiosk package. You can use it to configure single-application mode more easily. Otherwise, use the following procedure.
Configurar o modo de aplicación única
-
Lock down settings to prevent printing, terminal access, and so on.
-
Configure automatic login in the /etc/gdm/custom.conf file for the user.
Vexa Configurar o inicio de sesión automático para obter máis información.
-
Create the following files with the listed content:
- /usr/share/applications/org.gnome.Kiosk.Script.desktop
[Desktop Entry] Name=Kiosko Type=Application Exec=gnome-kiosk- /usr/share/applications/org.gnome.Kiosk.WindowManager.desktop
[Desktop Entry] Type=Application Name=Mutter Comment=Xestor de xanelas 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/gnome-kiosk.session
[GNOME Session] Name=Kiosko RequiredComponents=org.gnome.Kiosk.WindowManager;org.gnome.Kiosk.Script;- /usr/share/X11/xorg.conf.d/20-gnome-kiosk.conf
Section "ServerFlags" Option "DontVTSwitch" "on" EndSection- /usr/share/xsessions/org.gnome.Kiosk.desktop
[Desktop Entry] Name=Kiosk Comment=Modo kiosko Exec=/usr/bin/gnome-session --session=gnome-kiosk DesktopNames=GNOME-Kiosk;GNOME;
-
As the user that will open the single-application session, create the /home/user/.local/bin/gnome-kiosk file:
[usuario]$ mkdir -p ~/.local/bin [usuario]$ touch ~/.local/bin/gnome-kiosk -
Edit the /home/user/.local/bin/gnome-kiosk file and enter the executable name of the application that you want to launch in single-application mode.
For example, to launch the Firefox browser in single-application mode, enter the following content:
#!/bin/sh while true; do firefox --kiosk https://example.org doneThe while true loop ensures that the application restarts if it terminates for any reason.
-
Fai o ficheiro executable:
[usuario]$ chmod +x ~/.local/bin/gnome-kiosk -
If you created the file or its containing directories as a different user than the single-application user, such as root, ensure that the file has the correct permissions:
# chown -R usuario:grupo ~usuario/.local At the GNOME login screen, select the Kiosk session from the gear button menu and log in as the single-application user.