Darkland | net

Login Screen Capture Under GDM/MDM and LightDM

Published on 27 December 2015 by amj
Updated: 09 July 2021 --amanda

GDM/MDM:
  • Create a text file using you favorite editor with the following content:
  • #!/bin/bash
    #********************************
    # Created YYYYMMDD --[USER]
    #
    #********************************
    
    stamp=$(date +%Y%m%d-%H%M%S)
    chvt 7 ; sleep 5 ; XAUTHORITY=/var/lib/mdm/:0.Xauth DISPLAY=:0.0 import -window root /home/[USER]/"$stamp"\ -\ gdm-shot-001.jpg
    
    The critical piece is the path /var/lib/mdm
  • Save file to your home directory, and name it capture (or whatever you want).
  • Run:
  • chmod a+x ./capture
  • Log out of X session
  • Press [ctrl]+[alt]+[F1]
  • Log in as [USER].
  • Run:
  • sudo ./capture
  • Change ownership of file to [USER].
  • sudo chown [USER]: ./"$stamp"\ -\ gdm-shot-001.jpg
  • Log out of terminal
  • Press [ctrl]+[alt]+[F7]
  • Log in to X session.

  • LightDM (Shitty, shitty, super shitty, beyond shitty lightdm):
    Reference: https://www.ubuntubuzz.com/2020/01/take-screenshot-of-lightdm-login-screen-in-2020.html
  • Create a text file using you favorite editor with the following content:
  • #!/bin/bash
    #********************************
    # Created YYYYMMDD --[USER]
    #
    #********************************
    
    stamp=$(date +%Y%m%d-%H%M%S)
    chvt 7 ; sleep 5 ; DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 import -window root /home/[USER]/"$stamp"\ -\ lightdm-shot.png ; chvt 1
    
    The critical piece is the path /var/lib/lightdm/root/
  • Save file to your home directory, and name it capture (or whatever you want).
  • Run:
  • chmod a+x ./capture
  • Log out of X session
  • Press [ctrl]+[alt]+[F1]
  • Log in as [USER].
  • Run:
  • sudo ./capture
  • Change ownership of file to [USER].
  • sudo chown [USER]: ./"$stamp"\ -\ lightdm-shot-001.jpg
  • Log out of terminal
  • Press [ctrl]+[alt]+[F7]
  • Log in to X session.
  • Back