Add support for profile switching in nogui mode.