Setting DISPLAY variable on a remote XServer session
0
votes
0
answers
364
views
I have a CentOS system running an
X2go server
and I use a client machine to connect to it. I'm trying to do some command-line automation for mouse-clicks using xdotool
. The automation is scripted in bash and is placed in /etc/profile.d
. The idea is when any user logs into X2go server
from a client, the automation script should execute.
However, there is one issue with this approach. For xdotool
, a Xserver
session is needed. On further digging, I found that there is no display variable set when the session initiates and therefore the script fails (xdotool
). It takes about 30 seconds for the XSession
to fully establish before a display variable is set. I cannot simply add a sleep
in the bash script at it delays the login process since the script resides in /etc/profile.d
.
Any neat way to tacke this?
Asked by hypersonics
(163 rep)
Jun 29, 2022, 11:53 AM