5

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

2 Answers2

8

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/ppa

Li Lo
  • 16,382
2

try 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:

#!/bin/bash
mv conf1 tmp.conf1
mv conf2 conf1
mv tmp.conf1 conf2
nvidia-settings -l conf1

So this would toggle between the two settings

Oli
  • 299,380
sBlatt
  • 4,619