PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 07:05:36 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: [Solved] Run display resolution command at system startup  (Read 518 times)
johnkat9
Jr. Member
**
Offline Offline

Posts: 12


WWW
« on: October 24, 2011, 02: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?  
Logged
marcin82
Full Member
***
Offline Offline

Posts: 112


Metal is forever! // Yoda Królem Polski!


« Reply #1 on: October 24, 2011, 02:14:51 PM »

Copy any file *.desktop to directory:
Code:
/home/<user_name>/.config/autostart
Edit the file, place yout command in the field Exec:
Code:
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:
xrandr --newmode ... && xrandr --admode ... && xrandr --output ...
Check it out ...
Logged

marcin82
Leiche
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2703


God knows, i'm not an Angel!


WWW
« Reply #2 on: October 24, 2011, 03:54:20 PM »

better is a autostart script...

Code:
#!/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:
[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:
wbar -bpress -above-desk -vbar -pos left &

Good luck
Logged

johnkat9
Jr. Member
**
Offline Offline

Posts: 12


WWW
« Reply #3 on: October 24, 2011, 04:13:12 PM »

I tried this with no success
Logged
marcin82
Full Member
***
Offline Offline

Posts: 112


Metal is forever! // Yoda Królem Polski!


« Reply #4 on: October 24, 2011, 04: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:
chmod a+x /path/to/the/script.sh
Logged

marcin82
johnkat9
Jr. Member
**
Offline Offline

Posts: 12


WWW
« Reply #5 on: October 24, 2011, 05: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:
#!/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
Logged
Leiche
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2703


God knows, i'm not an Angel!


WWW
« Reply #6 on: October 25, 2011, 02:54:12 AM »

What desktop environment are you using?

missing...
Logged

johnkat9
Jr. Member
**
Offline Offline

Posts: 12


WWW
« Reply #7 on: October 25, 2011, 05:43:43 AM »

I am using KDE
Logged
Archie
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6885


I will never forget you, uhhh...


« Reply #8 on: October 25, 2011, 05:52:26 AM »

Just one of the many ways to do one thing ... ahh, Linux!  Grin
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM