How can I toggle Automatic Graphics Switching using terminal? I have a 15" MacBook Pro from May 2019 with a Radeon Pro 555X 4 GB graphics card. I would like to change the Automatic Graphics Switching setting with a terminal command.
The command sudo pmset -a gpuswitch n will set the graphics switching, with the following values for n:


2 is integrated gpu both on cable and battery 
1 is dedicated gpu only with power connected; integrated gpu on battery power
0 is dedicated gpu on both ac and battery


pmset -g will show you the current configuration.