I followed this guide on how to take a screenshot for the login screen.
However in Ubuntu 20.04 it doesn't work, I get the following error:
xwd: unable to open open display ':0'
Below is the script I'm using (extracted from the guide with a modified chvt
)
chvt 1;
sleep 5s;
DISPLAY=:0 XAUTHORITY=/var/lib/gdm/:0 xwd -root -out ~/screenshot.xwd;
convert ~/screenshot.xwd ~/screenshot.png;
rm ~/screenshot.xwd
chvt 7
goes to some weird version of the command line login screen. I have to usechvt 1
and alsoCtrl + Alt + F1
goes to the login screen and notCtrl + Alt + F7