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, 06:36:31 PM


Login with username, password and session length


Pages: 1 [2]   Go Down
  Print  
Author Topic: [SOLVED] Re: Autoloading 1280x1024 screen resolution with Xrandr?  (Read 1785 times)
AS
Global Moderator
Hero Member
*****
Offline Offline

Posts: 4139

Have a nice ... night!


« Reply #15 on: October 12, 2011, 08:03:19 PM »

Going back to the first post in this thread, it has to be manually loaded after each restart. No progress so far but still trying.

Thanks!

I can't believe the rc.local file didn't set it up perfectly.  What I would do is go
over to the XFCE forum and ask them exactly where or how to get them three
xrandr commands into a boot-up autostart file.  Is there an autostart option
on the main or config menu's ?    Don't give up yet.   Did you put an "&"  one
space after each command in the rc.local file ?   That's needed.

+1,

in addition use the absolute path: /usr/bin/xrandr

AS
Logged
rvinfo
Jr. Member
**
Offline Offline

Posts: 16


« Reply #16 on: October 12, 2011, 08:41:36 PM »

Nope, still not changing the resolution to 1280x1024 during bootup. Here are the last 3 lines of rc.local:

/usr/bin/xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync &
/usr/bin/xrandr --addmode VGA1 1280x1024_60.00 &
/usr/bin/xrandr --output VGA1 --mode 1280x1024_60.00 & (also tried it without this last "&" - no effect)

Still, after bootup completes I can open Terminal, paste these three lines from a text file on the desktop and hit enter to get it to change to 1280x1024.
 
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60.00
xrandr --output VGA1 --mode 1280x1024_60.00

When everybody here runs out of friendly suggestions, I will go bug the XFCE forum!  Thanks again!
Logged
Ferdes Fides
Hero Member
*****
Offline Offline

Posts: 830


In theory, theory=practice, in practice ???


« Reply #17 on: October 12, 2011, 09:21:20 PM »

Nope, still not changing the resolution to 1280x1024 during bootup. Here are the last 3 lines of rc.local:

/usr/bin/xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync &
/usr/bin/xrandr --addmode VGA1 1280x1024_60.00 &
/usr/bin/xrandr --output VGA1 --mode 1280x1024_60.00 & (also tried it without this last "&" - no effect)

Still, after bootup completes I can open Terminal, paste these three lines from a text file on the desktop and hit enter to get it to change to 1280x1024.
 
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60.00
xrandr --output VGA1 --mode 1280x1024_60.00

When everybody here runs out of friendly suggestions, I will go bug the XFCE forum!  Thanks again!

To make life a little easier I would make one script file
perhaps called "monitor1280" with the text editor.

Contents of file: monitor1280

# to change monitor mode to 1280x1024
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60.00
xrandr --output VGA1 --mode 1280x1024_60.00


In root, put the file monitor1280 into usr/bin with Thunar file manager.
In root, right click to properties,click permissions, and check "make the file executable".
You should be able to run the small file in the terminal just like
the three xrandr commands, but with just one line and command.
Put monitor1280 into the terminal and hit enter same as with xrandr.
Sometimes commands have to be run in a terminal and this just
might be the case here.   If it doesn't run post back and we'll check
the syntax and so forth.

Have a good one.
Logged

ASUS EeePc 900 netbook  900mhz Celeron CPU  1GB RAM
16 GB internal SSD  Seagate 250 GB USB portable drive 
Intel ‎Mobile 915GM/GMS/910GML Express Graphics Controller
Atheros AR5001 Wireless Network Adapter
Dynex 5-Button Wired Optical Mouse
Intel (ICH6 Family) High Definition Audio
rvinfo
Jr. Member
**
Offline Offline

Posts: 16


« Reply #18 on: October 12, 2011, 09:48:11 PM »

I am new at writing scripts but I pasted this:

# to change monitor mode to 1280x1024
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60.00
xrandr --output VGA1 --mode 1280x1024_60.00

Into a text file on the desktop and named it monitor1280.sh since I couldn't change a plain text file to be executable.

Copied it to /usr/bin which I opened as root, pasted it in and told it to open with terminal. Opened Terminal, typed monitor1280.sh and got this:

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  150 (RANDR)
  Minor opcode of failed request:  16 (RRCreateMode)
  Serial number of failed request:  31
  Current serial number in output stream:  31

 
Logged
Ferdes Fides
Hero Member
*****
Offline Offline

Posts: 830


In theory, theory=practice, in practice ???


« Reply #19 on: October 12, 2011, 10:00:17 PM »


In the terminal go to root.   enter thunar, hit enter.
In Thunar we right click monitor1280.sh and should
see properties, permissions, somewhere to make it executable
with a checkbox.  Once that is done just type monitor1280.sh
into the terminal and hit enter.   I don't think it has to be a root
terminal but we still should be in root terminal right now.

It should work, my xrandr -q script worked about 5 minutes ago.
Don't need to open with terminal, or open at all there.   Just make
executable and type it in the terminal.    Any terminal.
Logged

ASUS EeePc 900 netbook  900mhz Celeron CPU  1GB RAM
16 GB internal SSD  Seagate 250 GB USB portable drive 
Intel ‎Mobile 915GM/GMS/910GML Express Graphics Controller
Atheros AR5001 Wireless Network Adapter
Dynex 5-Button Wired Optical Mouse
Intel (ICH6 Family) High Definition Audio
rvinfo
Jr. Member
**
Offline Offline

Posts: 16


« Reply #20 on: October 12, 2011, 10:12:31 PM »

Yes, I did followed your instructions and entered monitor1280.sh in a terminal window. I got the errors shown in my last post.

I think we are drifting away from my original goal of getting this set of commands to autostart when booting up but I figured some script writing experience wouldn't hurt.

Are you running XFCE like I am?
Logged
Ferdes Fides
Hero Member
*****
Offline Offline

Posts: 830


In theory, theory=practice, in practice ???


« Reply #21 on: October 12, 2011, 10:35:21 PM »

Yes, I did followed your instructions and entered monitor1280.sh in a terminal window. I got the errors shown in my last post.

I think we are drifting away from my original goal of getting this set of commands to autostart when booting up but I figured some script writing experience wouldn't hurt.

Are you running XFCE like I am?

Script writing...I think the file needs to be made executable and I don't have XFCE to look
at, so no I'm not running XFCE.   Ask them sometime how to do that with Xfce.   I thought
the script would be easier to use.   Xrandr might not be able to autostart but ask the Xfce
forum about that.   Xfce's an excellent distro, like a small Gnome to me.    I'll try running
the whole script on my machine sometime and see what happens, the video cards are
similar.

Have a good one.
Logged

ASUS EeePc 900 netbook  900mhz Celeron CPU  1GB RAM
16 GB internal SSD  Seagate 250 GB USB portable drive 
Intel ‎Mobile 915GM/GMS/910GML Express Graphics Controller
Atheros AR5001 Wireless Network Adapter
Dynex 5-Button Wired Optical Mouse
Intel (ICH6 Family) High Definition Audio
Ferdes Fides
Hero Member
*****
Offline Offline

Posts: 830


In theory, theory=practice, in practice ???


« Reply #22 on: October 12, 2011, 10:49:22 PM »

Hi rvinfo,

Those errors also appear on my machine, but when running
xrandr -q I'm at 1280x1024 mode and my little screen confirms
that.   So, I think your script is working OK and those errors
are not serious (color or font ?).    Check after reboot sometime.

FF
Logged

ASUS EeePc 900 netbook  900mhz Celeron CPU  1GB RAM
16 GB internal SSD  Seagate 250 GB USB portable drive 
Intel ‎Mobile 915GM/GMS/910GML Express Graphics Controller
Atheros AR5001 Wireless Network Adapter
Dynex 5-Button Wired Optical Mouse
Intel (ICH6 Family) High Definition Audio
agmg
Full Member
***
Offline Offline

Posts: 147



« Reply #23 on: October 13, 2011, 02:45:57 AM »

You can try something else...

Make a file on a folder of your choice and save it as fix-resolution.sh (name it as you want, I give this as example).

Paste the following inside:

#!/bin/sh
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60.00
xrandr --output VGA1 --mode 1280x1024_60.00

Make it executable using the command "chmod +x /folder/fix-resolution.sh" (replace folder with the location you saved the file)

Now go to Xfce settings -> Session and startup

and create a new entry pointing to that file. It will make it start every time you log on. Hopefully it will work for you...
Logged



PCLinuxOS Phoenix is great... PCLinuxOS KDE is perfect!
rvinfo
Jr. Member
**
Offline Offline

Posts: 16


« Reply #24 on: October 13, 2011, 07:27:44 AM »

It works! Thank you agmg and everyone who contributed!
Logged
agmg
Full Member
***
Offline Offline

Posts: 147



« Reply #25 on: October 13, 2011, 02:23:02 PM »

Glad I could help Smiley

I'm still learning linux, like you...
Logged



PCLinuxOS Phoenix is great... PCLinuxOS KDE is perfect!
Ferdes Fides
Hero Member
*****
Offline Offline

Posts: 830


In theory, theory=practice, in practice ???


« Reply #26 on: October 13, 2011, 02:51:52 PM »

It works! Thank you agmg and everyone who contributed!

BTW

Don't worry about the error message.   It doesn't appear if the script is only
run once, which is where it is at.   If the script is run twice, the error message
appears, which will not happen where it is at.

Moving on to something else.

FYI   Grin  Cheesy  Wink
Logged

ASUS EeePc 900 netbook  900mhz Celeron CPU  1GB RAM
16 GB internal SSD  Seagate 250 GB USB portable drive 
Intel ‎Mobile 915GM/GMS/910GML Express Graphics Controller
Atheros AR5001 Wireless Network Adapter
Dynex 5-Button Wired Optical Mouse
Intel (ICH6 Family) High Definition Audio
Pages: 1 [2]   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