You are not logged in.

#1 2011-02-09 17:42:06

Aventinus
Member
From: On A Personal Voyage
Registered: 2010-09-11
Posts: 147

Making Resolution Permanent via XRandR [SOLVED]

Hello guys, I just made the big move from GNOME to XFCE, but there a slight problem, I can't seem to make my native resolution permanent. In GNOME I used to add my resolution (1920x1080) via Xrandr and then add the commands

xrandr --newmode "1920x1080_60.00" 148.35 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
xrandr --addmode VGA-0 1920x1080_60.00
xrandr --output VGA-0 --mode 1920x1080_60.00

to the /etc/gdm/PreSession/Default file. Although I use GDM in XFCE now, doing the same thing doesn't work. Any ideas?
I know that an alternative way is to add these commands to xprofile. But that doesn't work either. Maybe I do something wrong.

Can you help me?

Thanks!

Last edited by Aventinus (2011-02-17 19:10:07)


"Somewhere, something incredible is waiting to be known." - Carl Sagan

Offline

#2 2011-02-09 18:10:44

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Making Resolution Permanent via XRandR [SOLVED]

Putting that magic in an xorg.conf file would be the most sensible way to go. The fact Xorg runs without config by default doesn't mean you can add one to tell it how to behave smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2011-02-09 18:12:39

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Making Resolution Permanent via XRandR [SOLVED]

Aventinus wrote:

I know that an alternative way is to add these commands to xprofile. But that doesn't work either.

That should be .xinitrc or .xsession.

Nvm tongue

Last edited by litemotiv (2011-02-09 18:14:08)


ᶘ ᵒᴥᵒᶅ

Offline

#4 2011-02-09 18:18:35

Aventinus
Member
From: On A Personal Voyage
Registered: 2010-09-11
Posts: 147

Re: Making Resolution Permanent via XRandR [SOLVED]

litemotiv wrote:
Aventinus wrote:

I know that an alternative way is to add these commands to xprofile. But that doesn't work either.

That should be .xinitrc or .xsession.

Nvm tongue

litemotiv I did tried .xinitrc, this is my .xinitrc file:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

# exec gnome-session
# exec startkde
exec ck-launch-session  startxfce4
xrandr --newmode "1920x1080_60.00" 148.35 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync &
xrandr --addmode VGA-0 1920x1080_60.00 &
xrandr --output VGA-0 --mode 1920x1080_60.00 &
# ...or the Window Manager of your choice

But it doesn't work. Any ideas?

.:B:. I know xorg.conf is an option, but in every distro and in every Enviroment I have succeded to make my resolution permanent without using xorg.conf which is a powerful yet hard-to-use tool in my opinion.


"Somewhere, something incredible is waiting to be known." - Carl Sagan

Offline

#5 2011-02-09 18:54:08

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Making Resolution Permanent via XRandR [SOLVED]

10-monitor.conf is another option


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2011-02-09 19:13:01

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Making Resolution Permanent via XRandR [SOLVED]

Aventinus wrote:

litemotiv I did tried .xinitrc, this is my .xinitrc file:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

# exec gnome-session
# exec startkde
exec ck-launch-session  startxfce4
xrandr --newmode "1920x1080_60.00" 148.35 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync &
xrandr --addmode VGA-0 1920x1080_60.00 &
xrandr --output VGA-0 --mode 1920x1080_60.00 &
# ...or the Window Manager of your choice

I think you need to place it before starting your desktop environment, like this:

exec xrandr --newmode "1920x1080_60.00" 148.35 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
exec xrandr --addmode VGA-0 1920x1080_60.00
exec xrandr --output VGA-0 --mode 1920x1080_60.00
exec ck-launch-session  startxfce4

(not tested!)


ᶘ ᵒᴥᵒᶅ

Offline

#7 2011-02-09 19:16:28

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: Making Resolution Permanent via XRandR [SOLVED]

@Aventinus - I think its not working because you're putting the xrandr lines after the exec one.

Edit: and litemotiv beat me to it tongue

Last edited by anonymous_user (2011-02-09 19:17:05)

Offline

#8 2011-02-09 19:40:36

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: Making Resolution Permanent via XRandR [SOLVED]

I believe that setting the resolution using the Display applet in settings manager is meant to restore the chosen setup at restart.

Offline

#9 2011-02-09 19:51:49

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: Making Resolution Permanent via XRandR [SOLVED]

I believe there should be only *one* "exec" in .xinitrc, and that it should be on the last line.

Offline

#10 2011-02-17 19:09:13

Aventinus
Member
From: On A Personal Voyage
Registered: 2010-09-11
Posts: 147

Re: Making Resolution Permanent via XRandR [SOLVED]

I confirm that the right way to do this is:

xrandr --newmode "1920x1080_60.00" 148.35 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
xrandr --addmode VGA-0 1920x1080_60.00
xrandr --output VGA-0 --mode 1920x1080_60.00
exec ck-launch-session  startxfce4

If you put "exec" in every line the X won't start!

Thank you all for your help!


"Somewhere, something incredible is waiting to be known." - Carl Sagan

Offline

Board footer

Powered by FluxBB