Hijack an X11 Session

This is useful if, for example, you have access to a serial console, and need to run a program on the display.

First, identify the window / session manager, in this case it is lxsession.

. <( cat /proc/$(pgrep lxsession)/environ | xargs -0n1 | sed -rne '/^(DISPLAY|XAUTHORITY)=/{s/^/export /;p}' )