File nikau-client.service of Package nikau
[Unit]
Description=Start nikau-client-%u.service
PartOf=graphical-session.target
After=graphical-session-pre.target gnome-session.target
# Make sure the unit isn't restarted endlessly, see RestartSec= below
StartLimitInterval=60
StartLimitBurst=3
# Set this variable e.g. in $HOME/.config/environment.d
ConditionEnvironment=NIKAU_SERVER
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/bin/sh -c "echo DISPLAY=${DISPLAY} >/run/user/%U/nikau_client_environment"
ExecStartPre=-/bin/sh -c "echo XAUTHORITY=${XAUTHORITY} >>/run/user/%U/nikau_client_environment"
ExecStartPre=-/bin/sh -c "echo NIKAU_SERVER=${NIKAU_SERVER} >>/run/user/%U/nikau_client_environment"
ExecStart=/usr/bin/systemctl start nikau-client@%U.service
#It is recommended to create a polkit rule to allow this without password
ExecStop=/usr/bin/systemctl stop nikau-client@%U.service
ExecStopPost=rm -f /run/user/%U/nikau_client_environment
Restart=on-failure
RestartSec=10
[Install]
WantedBy=graphical-session.target