Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What i want to do is get this custom screen resolution with xrandr to run at every boot so i don't have to enter it myself or copy and past it this is the code i want to run at every boot

cvt 800 600 60 && xrandr --newmode "800x600_60.00"   38.25  800 832 912 1024  600 603 607 624 -hsync +vsync && xrandr --addmode TV1 800x600_60.00 && xrandr --output TV1 --mode 800x600_60.00

i don't really want to play around editing configure/files just a nice easy script that will execute after or during every boot.

share|improve this question

If you want it to execute before the login manager, just put it at the end of /etc/rc.local

share|improve this answer
I don't really know what i'm doing but i added my code to /etc/rc.local saved and rebooted and it did nothing. I re-looked at it and saw that it said this script does nothing In order to enable or disable this script just change the execution bits. So how would i do that – Matt May 26 '13 at 16:29

You can try putting your commands in ~/.profile. This file is executed when you log in, so you should see the resolution change at that point.

I can't guarantee this method though, because I don't know if your system has other startup scripts in the home folder.

As for rc.local, it should be executable by default. If it isn't, you can sudo nautilus to browse as root, then right-click on the file and select "Properties". From here you can make the script executable so it will work. You can also use chmod, but I thought you would prefer this method.

One more tip: running cvt only gives you the data you need for xrandr. You can drop it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.