Author Topic: [SOLVED] Re: Autoloading 1280x1024 screen resolution with Xrandr?  (Read 4748 times)

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #15 on: October 12, 2011, 07: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

Offline rvinfo

  • Jr. Member
  • **
  • Posts: 16
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #16 on: October 12, 2011, 07: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!

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1477
  • In theory, theory=practice, in practice ???
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #17 on: October 12, 2011, 08: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.
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline rvinfo

  • Jr. Member
  • **
  • Posts: 16
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #18 on: October 12, 2011, 08: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

 

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1477
  • In theory, theory=practice, in practice ???
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #19 on: October 12, 2011, 09: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.
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline rvinfo

  • Jr. Member
  • **
  • Posts: 16
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #20 on: October 12, 2011, 09: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?

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1477
  • In theory, theory=practice, in practice ???
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #21 on: October 12, 2011, 09: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.
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1477
  • In theory, theory=practice, in practice ???
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #22 on: October 12, 2011, 09: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
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1900
  • Certified Windows Hater
Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #23 on: October 13, 2011, 01: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...
For the whole world, you are someone.
For someone, you are the whole world.

Offline rvinfo

  • Jr. Member
  • **
  • Posts: 16
[SOLVED] Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #24 on: October 13, 2011, 06:27:44 AM »
It works! Thank you agmg and everyone who contributed!

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1900
  • Certified Windows Hater
Re: [SOLVED] Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #25 on: October 13, 2011, 01:23:02 PM »
Glad I could help :)

I'm still learning linux, like you...
For the whole world, you are someone.
For someone, you are the whole world.

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1477
  • In theory, theory=practice, in practice ???
Re: [SOLVED] Re: Autoloading 1280x1024 screen resolution with Xrandr?
« Reply #26 on: October 13, 2011, 01: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   ;D  :D  ;)
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE