Use display-graphic-p
to determine if Emacs is in a GUI or not.
Assuming solarized is installed and loaded:
(if (display-graphic-p)
(enable-theme 'solarized)
(enable-theme 'wheatgrass))
See also: Is there a way to detect that emacs is running in a terminal?Is there a way to detect that emacs is running in a terminal?