Shaikh Al-Albaani was asked about wearing sunglasses, so he said, “Actions are judged by their intentions. They are permissible if someone wears them to protect himself from the sun. But if by wearing them he wants to hunt pretty girls in order to satisfy his animalistic impulses, then it is haram!”
Al-Hudā wan-Nūr, no. 1256.