I guess this is maybe one simple command but I haven't found it so far.
I'm running an Ubuntu-Server 16.04 LTS. Usually I have no Display connected to it, but since it runs an application which needs a GUI I have a cronjob set up to start the
~/.config/autostart/myscript.sh I'm starting the application.
This works all fine.
My problem is: Sometimes I have to change something in the configuration and I cannot do this via the terminal but have to use the GUI of the application.
But when I connect a display on the running Server it stays black.
After rebooting it recognizes the display again. But if I disconnect it now,
xfce4 fails and ends the session (=> also terminates my application.)
So that until now I always have to go
- connect the display
- reboot the Server
- do stuff in the GUI
- disconnect the display
- reboot server again
This is ofcourse very stupid and the application shouldn't go down just because of a little config change so: Is there any way to make the server recognize the display without a reboot?
I found this answer and running
xrandr --query -display :0.0
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767 DP1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) HDMI2 connected (normal left inverted right x axis y axis) 1920x1080 60.00 + 50.00 59.94 1920x1080i 60.00 50.00 59.94 1680x1050 59.88 1400x1050 59.95 1600x900 60.00 1280x1024 75.02 60.02 1440x900 59.90 1280x800 59.91 1152x864 75.00 1280x720 60.00 50.00 59.94 1024x768 75.08 60.00 800x600 75.00 60.32 720x576 50.00 720x480 60.00 59.94 640x480 75.00 60.00 59.94 720x400 70.08 VIRTUAL1 disconnected (normal left inverted right x axis y axis)
But the display is still saying
and goes black.
As suggested by dessert I ran
xrandr --output HDMI2 --auto
Can't open display