I am trying to determine whether or not I am in a graphical environment via bash on a Mac.
The goal is to have an if/else structure within a bash script that can handle these two cases.
Case 1: I can open windows from the command-line.
Case 2: I cannot open windows from the command-line.


ps).