How to automatically set the $DISPLAY variable for current session in UNIX/Linux

If you use XWindows, sometimes you need to set the DISPLAY for the session to transfer to your local laptop/desktop. With the following tip you can allow Unix/Linux to automatically setting it for you.