Author Topic: [Solved] Run display resolution command at system startup  (Read 1380 times)

Offline johnkat9

  • Jr. Member
  • **
  • Posts: 12
    • JaQ Solutions
[Solved] Run display resolution command at system startup
« on: October 24, 2011, 01:04:45 PM »
I would like the following command to be run automatically at system startup >
xrandr --output VGA1 --mode "1280x800_75.00"
Would someone have detailed instructions on how I would do this?  
« Last Edit: October 25, 2011, 06:11:07 AM by johnkat9 »

Offline marcin82

  • Full Member
  • ***
  • Posts: 119
  • Metal is forever! // Yoda Królem Polski!
Re: Run display resolution command at system startup
« Reply #1 on: October 24, 2011, 01:14:51 PM »
Copy any file *.desktop to directory:
Code: [Select]
/home/<user_name>/.config/autostartEdit the file, place yout command in the field Exec:
Code: [Select]
Exec=xrandr --output VGA1 --mode "1280x800_75.00"=======
I'm not sure, that before executing command xrandr --output commands xrandr --newmode and xrandr --addmode should be executed first, you can use:
Code: [Select]
xrandr --newmode ... && xrandr --admode ... && xrandr --output ...Check it out ...
marcin82

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3731
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Run display resolution command at system startup
« Reply #2 on: October 24, 2011, 02:54:20 PM »
better is a autostart script...

Code: [Select]
#!/bin/bash
xrandr --output VGA1 --mode "1280x800_75.00" &
Save it as autostart, or autostart.sh, and store it under Autostart folder in your home directory.
Make this script executable, right click, properties, permissions, Make the file executable.

If you use LXDE, then save it in a another place, maybe ~/.local/share/autostart.
Now generate a desktop file aka
Code: [Select]
[Desktop Entry]
Type=Application
Name=xrandr VGA1
Exec=~/.local/share/autostart
NoDisplay=true

and save it in autostart folder.

Logout/in, and it should work.

The best on this script is, you can add other commands as sample a old command (not longer needed)
Code: [Select]
wbar -bpress -above-desk -vbar -pos left &
Good luck

Offline johnkat9

  • Jr. Member
  • **
  • Posts: 12
    • JaQ Solutions
Re: Run display resolution command at system startup
« Reply #3 on: October 24, 2011, 03:13:12 PM »
I tried this with no success

Offline marcin82

  • Full Member
  • ***
  • Posts: 119
  • Metal is forever! // Yoda Królem Polski!
Re: Run display resolution command at system startup
« Reply #4 on: October 24, 2011, 03:16:33 PM »
What desktop environment are you using?

Quote from: Leiche
Make the file executable.
Did you do this? For example (as root #):
Code: [Select]
chmod a+x /path/to/the/script.sh
marcin82

Offline johnkat9

  • Jr. Member
  • **
  • Posts: 12
    • JaQ Solutions
Re: Run display resolution command at system startup
« Reply #5 on: October 24, 2011, 04:34:04 PM »
I have it working now. Here is what I did...
Create a folder in the Home directory and named it Autostart
Create a text file in the folder named autostart
Place this command in the text file
Code: [Select]
#!/bin/bash
xrandr --newmode "1280x800_75"  106.50  1280 1360 1488 1696  800 803 809 838 -hsync +vsync
xrandr --addmode VGA1 "1280x800_75"
xrandr --output VGA1 --mode "1280x800_75"
Save and close the file
Right click on the autostart file
Select "properties"
Select "permissions"
Put a check in the box "Is executable"
Click "Okay"
Go to and select "Configure Your Desktop"
Select "System Administration" and "Startup and Shutdown"
Select "Autostart" and "Add Program"
In "Chose Application" browse to and select the autostart file in the Home directory
Select "Okay"
Close "Startup and Shutdown"
The screen resolution will now be set to 1280x800 75Hz when I start the system
« Last Edit: October 25, 2011, 05:03:04 AM by johnkat9 »

Online daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3731
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Run display resolution command at system startup
« Reply #6 on: October 25, 2011, 01:54:12 AM »
What desktop environment are you using?

missing...

Offline johnkat9

  • Jr. Member
  • **
  • Posts: 12
    • JaQ Solutions
Re: Run display resolution command at system startup
« Reply #7 on: October 25, 2011, 04:43:43 AM »
I am using KDE

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: Run display resolution command at system startup
« Reply #8 on: October 25, 2011, 04:52:26 AM »
Just one of the many ways to do one thing ... ahh, Linux!  ;D
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42