VMware Horizon Community
amoriconi
Contributor
Contributor

Run Script after X server startup

I have a RHEL Server 7.6 VM with Horizon Agent for Linux 2106 installed, it is possibile to run a custom script after login or after X session is started? I try with .xinitrc and .xsession but seems that this script were ignored. Dedicated X Server was started from Horizon script /usr/lib/vmware/viewagent/bin/StartXServer.sh, in the same directory there some other scripts like PostLogin.sh and PostLogout.sh can I use this?

Labels (1)
Tags (1)
Reply
0 Kudos
1 Reply
Hangl
VMware Employee
VMware Employee

It depends.
If your script intends to run under the logged-in user you can try it with /etc/xdg/autostart/ or PostLogin.sh.
If your script intends to run under root and before user login or right after greeter started, you can investigate in GDM's auto-start mechanism by looking at below directory/file and links.

 

ls /etc/gdm/{Init,P{ost{Login,Session},reSession}}
/usr/share/gdm/autostart/
/usr/share/gdm/greeter/autostart/

 

Reference:
https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html 
https://help.gnome.org/admin/gdm/stable/configuration.html.en 

Reply
0 Kudos