Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-02-09 09:02:26

stevodrevo
Member
Registered: 2024-02-09
Posts: 5

XFCE4 based kiosk

Hi guys,

I am working on a set of kiosks (based on Xubuntu 23.10) running an electron app on touchscreen monitors for educational institution. After a week of tries and fails I have it almost done with success. Started with Alpine, moved to Ubuntu server minimal and settled on Xubuntu as there is the least amount of installation complexity.

To have it automated I created a script which I run after installing Xubuntu. I edit/create /etc/xdg/xfce4/xfconf/xfce-perchannel-xml files, /etc/xdg/xfce4/kiosk/kioskrc file, /etc/lightdm/lightdm.conf. Then a kiosk user is created without password, AppImage app copied to the user's directory, autostart setup and lightdm started/machine rebooted...

There are however some issues I would like to ask you for an advice. I'd like the machines to start a screensaver after 10 minutes of inactivity. And then after the screen is touched, I want an app screen to appear again without login screen. So far all my attempts led to having a login screen appear after returning from screensaver, hibernation or sleep...

Any discussion on this topic or ideas on kiosk setup are greatly appreciated.

Here is the script so you have an idea:

#!/bin/sh

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Xubuntu Kiosk Setup
#
# Based on Xubuntu 23.10 minimal installation
#
# Author: Stefan Hudac, DataX Computing, spol. s r. o.
#
# Usage:
#     * Install Xubuntu 23.10 minimal
#     * Restart system and login
#     * Optional: Install sshd if needed: sudo apt install openssh-server
#       (e.g. if kiosk is being setup remotely)
#     * Edit variables in following section of the file and copy it to kiosk
#       machine (wget is installed, for local edits vim or nano needs to be
#       installed)
#     * Set permissions: chmod u+x setup-kiosk-xubuntu-v2.sh
#     * Run the script as sudoer
#     * Remember to set a computer to start on "power on" in BIOS
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

USER=kiosk
WALLPAPERNAME=bkg_1920x1080_01.png
WALLPAPERURL=http://files.datax.biz/datax/$WALLPAPERNAME
APPNAME=supper-app-1.0.0.AppImage
APPURL=http://files.datax.biz/super-app/$APPNAME

# Update and upgrade system
#
apt-get update -y && apt-get upgrade -y

# Wallpaper
#
mkdir -p /usr/share/backgrounds/kiosk
wget --directory-prefix=/usr/share/backgrounds/kiosk/ $WALLPAPERURL

# Desktop settings
#
cat << EOF > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-desktop" version="1.0">
    <property name="desktop-icons" type="empty">
        <property name="file-icons" type="empty">
            <property name="show-filesystem" type="bool" value="false" />
            <property name="show-home" type="bool" value="false" />
            <property name="show-removable" type="bool" value="false" />
            <property name="show-trash" type="bool" value="false" />
        </property>
        <property name="show-thumbnails" type="bool" value="false" />
        <property name="show-tooltips" type="bool" value="false" />
        <property name="style" type="int" value="0" />
    </property>
    <property name="desktop-menu" type="empty">
        <property name="show" type="bool" value="false" />
    </property>
    <property name="windowlist-menu" type="empty">
        <property name="show" type="bool" value="false" />
    </property>
    <property name="backdrop" type="empty">
        <property name="screen0" type="empty">
            <property name="monitor0" type="empty">
                <property name="image-path" type="string"
                    value="/usr/share/backgrounds/kiosk/$WALLPAPERNAME" />
                <property name="image-style" type="int" value="5" />
                <property name="image-show" type="bool" value="true" />
                <property name="workspace0" type="empty">
                    <property name="last-image" type="string"
                        value="/usr/share/backgrounds/kiosk/$WALLPAPERNAME" />
                </property>
            </property>
            <property name="monitor1" type="empty">
                <property name="image-path" type="string"
                    value="/usr/share/backgrounds/kiosk/$WALLPAPERNAME" />
                <property name="image-style" type="int" value="5" />
                <property name="image-show" type="bool" value="true" />
            </property>
        </property>
    </property>
</channel>
EOF

cat << EOF > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="uint" value="5"/>
    <property name="lock-screen-suspend-hibernate" type="bool" value="false"/>
    <property name="presentation-mode" type="bool" value="true"/>
  </property>
</channel>
EOF

cat << EOF > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-session" version="1.0">
  <property name="general" type="empty">
    <property name="FailsafeSessionName" type="string" value="Failsafe"/>
    <property name="LockCommand" type="string" value=""/>
  </property>
  <property name="sessions" type="empty">
    <property name="Failsafe" type="empty">
      <property name="IsFailsafe" type="bool" value="true"/>
      <property name="Count" type="int" value="5"/>
      <property name="Client0_Command" type="array">
        <value type="string" value="xfwm4"/>
      </property>
      <property name="Client0_Priority" type="int" value="15"/>
      <property name="Client0_PerScreen" type="bool" value="false"/>
      <property name="Client1_Command" type="array">
        <value type="string" value="xfsettingsd"/>
      </property>
      <property name="Client1_Priority" type="int" value="20"/>
      <property name="Client1_PerScreen" type="bool" value="false"/>
      <property name="Client2_Priority" type="int" value="25"/>
      <property name="Client2_PerScreen" type="bool" value="false"/>
      <property name="Client3_Command" type="array">
        <value type="string" value="Thunar"/>
        <value type="string" value="--daemon"/>
      </property>
      <property name="Client3_Priority" type="int" value="30"/>
      <property name="Client3_PerScreen" type="bool" value="false"/>
      <property name="Client4_Command" type="array">
        <value type="string" value="xfdesktop"/>
      </property>
      <property name="Client4_Priority" type="int" value="35"/>
      <property name="Client4_PerScreen" type="bool" value="false"/>
    </property>
  </property>
</channel>
EOF

mkdir -p /etc/xdg/xfce4/kiosk
cat << EOF > /etc/xdg/xfce4/kiosk/kioskrc
[xfce4-panel]
CustomizePanel=NONE

[xfce4-session]
CustomizeSplash=NONE
CustomizeChooser=NONE
CustomizeLogout=NONE
CustomizeCompatibility=NONE
Shutdown=NONE
CustomizeSecurity=NONE

[xfdesktop]
UserMenu=NONE
CustomizeBackdrop=NONE
CustomizeDesktopMenu=NONE
CustomizeWindowlist=NONE
CustomizeDesktopIcons=NONE
EOF

# Create user
#
useradd -m $USER

# Get electron application
#
rm -f /home/$USER/$APPNAME
wget --directory-prefix=/home/$USER/ $APPURL
chmod u+x /home/$USER/$APPNAME
chown -R $USER:$USER /home/$USER/$APPNAME

# Autologin
#
cat << EOF > /etc/lightdm/lightdm.conf
[Seat:*]
autologin-user-timeout=0
autologin-user=$USER
user-session=xfce
# Hide mouse cursor
xserver-command=X -nocursor
EOF

# Autostart
#
mkdir -p /home/$USER/.config/autostart
cat << EOF > /home/$USER/.config/autostart/kiosk.desktop
[Desktop Entry]
Type=Application
Name=Kiosk
Exec=/home/$USER/$APPNAME
X-GNOME-Autostart-enabled=true
EOF
chown -R $USER:$USER /home/$USER/.config

systemctl start lightdm

Last edited by stevodrevo (2024-02-09 10:13:40)

Offline

#2 2024-02-09 10:07:42

stevodrevo
Member
Registered: 2024-02-09
Posts: 5

Re: XFCE4 based kiosk

Adding another issue. While I was testing booting the machine having DP monitor plugged in, or HDMI monitor plugged in everything worked as desired.

However when having unplugged monitor and booting, and then plugging monitor in after boot a Display Setup dialog appears. Which is not good...

Offline

#3 2024-02-09 10:10:12

stevodrevo
Member
Registered: 2024-02-09
Posts: 5

Re: XFCE4 based kiosk

And while I am at it. A notification appears in right top corner about connected network after boot. Which disappears after while but is unnecessary... Any idea how do disable those?

Offline

#4 2024-02-09 13:49:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,900

Re: XFCE4 based kiosk

stevodrevo wrote:

And while I am at it. A notification appears in right top corner about connected network after boot. Which disappears after while but is unnecessary... Any idea how do disable those?

Assuming the network manager applet, right-click the ion and uncheck "Enable Notifications".

If you're looking for a system-wide disable, you'll need to investigate gnome schema changes - the default one for nm-applet is located at /usr/share/glib-2.0/schemas/org.gnome.nm-applet.gschema.xml. I'm not too familiar with how schemas work, but I believe you can create a file with the same name but with ".override" appended to the end of it and include the changes/overrides that you would like to use.

However when having unplugged monitor and booting, and then plugging monitor in after boot a Display Setup dialog appears. Which is not good...

Settings Manager > Displays > Advanced > "When new displays are connected:" - set it to "Do Nothing". The setting is saved into the displays.xml file. If the problem persists even after this setting is changed, also look at your keyboard shortcuts to see if you have a shortcut bound to "XF86Display" or "Display" and delete that shortcut.

There are however some issues I would like to ask you for an advice. I'd like the machines to start a screensaver after 10 minutes of inactivity. And then after the screen is touched, I want an app screen to appear again without login screen. So far all my attempts led to having a login screen appear after returning from screensaver, hibernation or sleep..

I believe the default "screensaver" in Xubuntu is light-locker, which is a locker. You might consider uninstalling it and using xfce4-screensaver instead - it has an option to enable/disable the lock screen.

Thanks for sharing your scripts - there is the occasional question about kiosk mode with Xfce and its good that someone is documenting it. A complete HowTo would be very useful as the existing documentation is somewhat limited.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2024-02-12 08:58:49

stevodrevo
Member
Registered: 2024-02-09
Posts: 5

Re: XFCE4 based kiosk

Dear Admin.

Thank you very much for your advice. I incorporated the leads into the script. I'll be glad to create howto once the quirks are smoothed out.

I have still few things I'd appreciate your advice on.

1. Login required after returning from screensaver:
---------------------------------------------------------
Screen is blank after 5 mins - blank screensaver is used (mode=0). After hitting touchscreen the login screen appears again on the display, which is not good. I changed the files accordingly:

cat << EOF > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">

    <property name="power-button-action" type="int" value="0"/>
    <property name="hibernate-button-action" type="int" value="0"/>
    <property name="sleep-button-action" type="int" value="0"/>
    <property name="battery-button-action" type="int" value="0"/>

    <property name="lock-screen-suspend-hibernate" type="bool" value="false"/>

    <!-- presentstion-mode set to true turns off dpms and screensaver -->
    <property name="presentation-mode" type="bool" value="false"/>

    <property name="dpms-enabled" type="bool" value="true"/>
    <property name="dpms-on-ac-off" type="int" value="60"/>
    <property name="dpms-on-ac-sleep" type="int" value="20"/>
    <property name="dpms-on-battery-off" type="int" value="30"/>
    <property name="dpms-on-battery-sleep" type="int" value="15"/>

    <property name="inactivity-sleep-mode-on-ac" type="int" value="1"/>
    <property name="inactivity-sleep-mode-on-battery" type="int" value="1"/>
  </property>
</channel>
EOF

cat << EOF > /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-screenserver.xml
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-screenserver" version="1.0">
  <property name="lock" type="empty">
    <property name="enabled" type="bool" value="false"/>
    <property name="sleep-activation" type="bool" value="false"/>
  </property>
  <property name="saver" type="empty">
    <property name="mode" type="int" value="0"/>
    <property name="idle-activation" type="empty">
      <property name="enabled" type="bool" value="true"/>
      <property name="delay" type="int" value="5"/>
    </property>
  </property>
</channel>
EOF

Desired behaviour is that there is no login required. Are there other configuration files involved? Or should there be a greeter configured in /etc/lightdm/lightdm.conf in order to have desired functionality? I am just getting into how lightdm functions and what can/should be configured...

2. No cursor
--------------
unclutter is not what I want, because it shows cursor while operating on the screen and hides it on inactivity. So I used xserver-command setting in /etc/lightdm/lightdm.conf

cat << EOF > /etc/lightdm/lightdm.conf
[Seat:*]
autologin-user-timeout=0
autologin-user=kiosk
user-session=xfce
# Hide cursor
xserver-command=X -nocursor
EOF

I wanted xserver-command=X -nocursor only to affect kiosk user. So when an admin logs in to the system the cursor is visible. I investigated the Seat settings in lightdm, but that's apparently not a right way. Tried all kinds of .xsession, .xsessionrc, .xinit, .xinitrc combinations without sucess. Is there a way to customize xserver-command per user?

3. kioskrc
-----------
I don't see changes in kioskrc affecting anything. When I login as kadmin user (the user created during login, which is sudoers member), I have access to xfce4-settings-manager, and can change whatever I tried so far.

cat << EOF > /etc/xdg/xfce4/kiosk/kioskrc
[xfce4-panel]
CustomizePanel=NONE

[xfce4-session]
CustomizeSplash=NONE
CustomizeChooser=NONE
CustomizeLogout=NONE
CustomizeCompatibility=NONE
Shutdown=NONE
CustomizeSecurity=NONE

[xfdesktop]
UserMenu=NONE
CustomizeBackdrop=NONE
CustomizeDesktopMenu=NONE
CustomizeWindowlist=NONE
CustomizeDesktopIcons=NONE
EOF


Your input is very valuable for me and I am really grateful for it.

Offline

#6 2024-02-12 23:56:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,900

Re: XFCE4 based kiosk

stevodrevo wrote:

1. Login required after returning from screensaver:
---------------------------------------------------------
Screen is blank after 5 mins - blank screensaver is used (mode=0). After hitting touchscreen the login screen appears again on the display, which is not good.

Make sure that light-locker is uninstalled and not currently running. Also, do not directly edit the xml files while Xfce (and more specifically, the "xfconfd" process) is running - your changes will be overwritten. Can you confirm that the above 2 are correct?

I am just getting into how lightdm functions and what can/should be configured...

Lightdm is just a display manager - it only allows you to log into a user session. light-locker is a complimentary program that utilizes lightdm, but provides the locking function.

2. No cursor
--------------
I wanted xserver-command=X -nocursor only to affect kiosk user. So when an admin logs in to the system the cursor is visible. I investigated the Seat settings in lightdm, but that's apparently not a right way. Tried all kinds of .xsession, .xsessionrc, .xinit, .xinitrc combinations without sucess. Is there a way to customize xserver-command per user?

Not that I am aware of. I did come across this thread that talks about writing your own program to enable/disable to cursor.

3. kioskrc
-----------
I don't see changes in kioskrc affecting anything. When I login as kadmin user (the user created during login, which is sudoers member), I have access to xfce4-settings-manager, and can change whatever I tried so far..

I don't have much experience with kiosk mode, but as I understand it, it can be finicky. Feel free to search this forum for the work "kiosk" as a number of people have asked and there as some potentially useful answers there.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2024-02-13 07:19:06

stevodrevo
Member
Registered: 2024-02-09
Posts: 5

Re: XFCE4 based kiosk

Thank you again for the reply.

My process while creating the solution is to ssh to machine, then sudo as root. To make changes I have a snippet to delete dedicated kiosk user:

systemctl stop lightdm
sleep 20
deluser $USER
rm -rf /home/$USER

Then I edit the files I write bout in this thread in /etc and other system directories.

After that I create dedicated kiosk user again, so the fxce4 settings take effect for the user and create necessary files in the kiosk user home directory. I have snippets for that as well already.

This way I have always the fresh dedicated kiosk user account with latest settings available.

1. Login required after returning from screensaver:
---------------------------------------------------------
Checked for light-locker, but not a mention of it in the system. I tried:

apt list --installed | grep locker
apt list --installed | grep light
ps -fax | grep locker
ps -fax | grep light

Any other idea you may share as to how to get rid of login screen after returning from the screensaver? I may share outputs of commands if that may help you to help me.

2. No cursor
--------------
Thank you for the lead. Will investigate.

3. kioskrc
-----------
Thank you. Already searching the forum left and right to gather as much information as possible.

Offline

#8 2024-02-13 20:00:36

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,900

Re: XFCE4 based kiosk

Can you post back the outputs of the following commands?

xfconf-query -c xfce4-screensaver -lv
xfconf-query -c xfce4-power-manager -lv
xfconf-query -c xfce4-session -lv

Looking at my Xubuntu 23.10 VM, I can't replicate the screen locking issue.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB