Gnome-shell single application mode (aka kiosk mode)

I’m trying to learn how to set up gnome-shell kiosk mode, both for my personal knowledge and also to contribute to gnome-user-docs and improve this doc page (see this issue).

Setup

I’d like to set up a kiosk mode for a deejay user who can run only one application (Lollypop or Rythmbox).
I’ll try to follow what seems to be the most logical order:

  1. Create a dedicated user, let’s call it deejay.

  2. Assign to that user a specific session called kiosk (yet to be defined) by adding this line to /var/lib/AccountsService/users/deejay:

    XSession=kiosk
    
  3. Create a launchable for the new session in the file /usr/share/xsessions/kiosk.desktop:

[Desktop Entry]
Name=kiosk
Exec=gnome-session --session kiosk
  1. Define the kiosk session in /usr/share/gnome-sessions/kiosk.session. This is mostly copied from gnome.session just as a starting point:
[GNOME Session]
Name=kiosk
RequiredComponents=kiosk-shell;org.gnome.Shell;org.gnome.SettingsDaemon.A11ySettings;org.gnome.SettingsDaemon.Color;org.gnome.SettingsDaemon.Datetime;org.gnome.SettingsDaemon.Housekeeping;org.gnome.SettingsDaemon.Keyboard;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Power;org.gnome.SettingsDaemon.PrintNotifications;org.gnome.SettingsDaemon.Rfkill;org.gnome.SettingsDaemon.ScreensaverProxy;org.gnome.SettingsDaemon.Sharing;org.gnome.SettingsDaemon.Smartcard;org.gnome.SettingsDaemon.Sound;org.gnome.SettingsDaemon.UsbProtection;org.gnome.SettingsDaemon.Wacom;org.gnome.SettingsDaemon.XSettings;
  1. The kiosk-shell of above RequiredComponents is a launchable you must create as /usr/share/applications/kiosk-shell.desktop and it will contain the call to gnome-shell kiosk mode:
 [Desktop Entry]
 Exec=gnome-shell --mode=kiosk
  1. Create the kiosk mode definition in /usr/share/gnome-shell/modes/kiosk.json to define the available gnome-shell user interface. Here’s what I tried:
{
    "parentMode": "user",
    "panel": { "left": ["activities", "appMenu"],
               "center": [],
               "right": ["aggregateMenu"]
    }
}

I’ve based this on what I read in gnome-shell source. But I’m just guessing and going ahead with trials&errors.

Test is failing

When I try to switch to deejay user I get the error “Something went wrong” and I’m redirected to login screen. Where can I get more information about the error? journalctl -b0 /usr/bin/gnome-shell doesn’t seem to show useful information, at least for me.

Do you have any idea of what I might be doing wrong?

There are some ugly cases right now due to the migration to systemd (where more changes will happen).

Try changing the gnome-session call to gnome-session --builtin for now. This will hopefully improve in the next GNOME release, see https://gitlab.gnome.org/GNOME/gnome-session/merge_requests/34

Thanks, I can log in.
Now I can try to figure out how to configure a real kiosk mode…