Great, got it working, these are the steps:
- In
tty1logout from Plasma sessions, sosddm-greeteris there. - Switch to
tty2withCONTROL+ALT+F2and login as root there, then run theresudo -i - Run the script
capture-sddm.shintty2 - Switch quickly to
tty1withCONTROL+ALT+F1and wait 20 seconds to take screenshot - Now the screenshot is in /root/ folder
This is the script capture-sddm.sh to be run as root:
TMPXAUTHORITY=$(ls /var/run/sddm/*)
sleep 15
DISPLAY=:0 XAUTHORITY=$TMPXAUTHORITY xwd -root > /root/greeter.xwd
convert /root/greeter.xwd /root/greeter.png
rm /root/greeter.xwd