Skip to content


How to automatically set display resolution with Nvidia graphic card on Linux


NVIDIA logo

Image via Wikipedia

Nvidia‘s Linux drivers are quite nice but they’re missing one very handy feature.

You can setup your configuration every time you boot the machine with a handy gui tool or you can store the config to the xorg.conf file and boot to the same configuration every time.

This is fine for desktops but it fails for laptops. Especially if you are using different configurations of external displays at home and at the office. In that case you’d probably like to have multiple configurations that would load automatically depending on the devices that are connected to the machine.

And I finally found the tool that enables me to do that(with a bit of bash scripting on the side). It’s called disper.
Disper enables you to set display configuration in the command line which is very handy for writing scripts.

Tux, the Linux penguin

Image via Wikipedia

So I wrote a script that allows you to save and load configuration very easily. Once you setup the displays in nvidia-settings you can simply run the script with the command “set_display save” and it will save the current configuration for you current display setup. You can also run ”set_display save home” and it will save the configuration as “home”.

When you’ll boot the machine next time, you’ll be able to run “set_display load” and it will load the appropriate configuration for you current setup(if it exists) or you can run “set_display load home” and it will load the configuration you saved as “home”. Handy, right? :)

Step by step setup:

  • Download and install disper
  • Download and extract my set display script
  • Link the set_display.sh script to your path (to /usr/bin for example)
  • Setup the displays using nvidia-settings
  • run “set_display save”
  • reboot and run “set_display load”
  • Add “set_display load” to autorun
  • Profit :)
This will probably work on any graphic card that is supported by the disper. But I didn’t test it so try it at your own risk(the second goes for nvidia cars as well :) ).
If you’ll encounter any problems or if you have any questions, please don’t be shy to ask.
Enhanced by Zemanta

Posted in digital world.

Tagged with , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.