I’m trying to take a screenshot of the sddm login screen (sddm or sddm-greeter), which is in tty1. I run the commands from tty2 and immediately return to tty1 but doesn’t work.
$ sleep 15; xwd -out screenshot.xwd -root -display :0.0
Authorization required, but no authorization protocol specified
xwd: unable to open display ':0.0'
This other command doesn’t work either:
$ TMPXAUTHORITY=$(ls /var/run/sddm/*); sleep 15; DISPLAY=:0 XAUTHORITY=$TMPXAUTHORITY xwd -root > "~/Desktop/greeter.xwd"
Authorization required, but no authorization protocol specified
xwd: unable to open display ':0'