Improve __links function

Now also uses the X driver when in an X server.