According to your detailed description of the situation, we can infer that your eyes have been infected with something, since the color of normal eye discharge is not green but white or yellow. In the mean time they are struck and attached to each other. So, I suggest that you consult an eye doctor as soon as possible. However, this happens from time to time, you don't have to worry too much.
When you are hard to open the eyes, it must be caused by the dryness. Your eyes may get the infection. About the green stuff, it may be the sediment through the daytime's dirty things which could not absorbed by the eye cornea. You'd better go to see the doctor and ask the actual problems.