cleanup: don't touch gui stuff when in cli mode