I have a Ubuntu machine next to my TV. Sometimes I use my TV (hdmi) as a secondary monitor, twinview.
Using the "NVidia X Server Setting", nvidia-settings, I can turn the second monitor (TV) on or off. (NVidia driver version is 260.19.06)
However, since I do this quite frequently I would like to install a keyboard shortcut. So step one is to turn on/off the 2nd monitor using command line.
Any idea on how to control this, using command line?
Cheers Leif
disper has worked very well for me for controlling an nVidia card for the same purpose. My second display was a TV, btw. You can install
disper
from this ppa: https://launchpad.net/~disper-dev/+archive/ppatry nvidia-settings -h
I'm not sure about this, but nvidia-settings seams to be a graphical front-end to edit ~/.nvidia-settings-rc
So if you save this file, use nvidia-settings, to add the TV display and save your settings, you should have two configuration files for your two setups.
Now use nvidia-settings -l conffile to change the configuration.
A bashscript could look like:
So this would toggle between the two settings