0

This is similar to Starting synergy automatically on RHEL/CentOS However this doesn't seem to be working anymore.

What I basically want to do is execute a program when the greeter is shown. THis has been working before by adding it to the /etc/gdm/Init/Default script. However right now the script doesn't seem to be called anymore (tested with a 'logger' call).

SElinux is in permissive mode. The script is executable. synergyc is specified with the full path.

  • I seemed to have found an alternative: cat /usr/share/gdm/greeter/autostart/synergyc.desktop [Desktop Entry] Type=Application Name=Synergy Client Exec=synergyc 192.168.1.110 #NoDisplay=true #AutostartCondition=GSettings org.gnome.desktop.a11y.applications screen-reader-enabled X-GNOME-AutoRestart=true Restart GDM and it works. – th3penguinwhisperer May 05 '21 at 10:39
  • Note that the autostart .desktop file does not restart synergyc when you log out of your session. So it works only once after gdm service has been restarted. – th3penguinwhisperer May 05 '21 at 11:02

1 Answers1

0

The below resolves the issue. So to make synergyc always running at the GDM greeter use the PostSession script below and put the /usr/share/gdm/greeter/autostart/synergyc.desktop file into place:

[Desktop Entry]
Type=Application
Name=Synergy Client
Exec=synergyc 192.168.1.110
X-GNOME-AutoRestart=true

/etc/gdm/PostSession/Default:

#!/bin/sh

# Kill old process
/usr/bin/killall synergyc
while [ $(pgrep -x synergyc) ]; do sleep 0.1; done

# Get the xauthority file GDM uses, setup DISPLAY var and start synergyc again
xauthfile=$(ps aux |grep Xauth | grep '^gdm' | grep -oP '\-auth \K[\w/]+')
export DISPLAY=:0
export XAUTHORITY=${xauthfile}
/usr/bin/synergyc 192.168.1.110

exit 0