You are not logged in.

#1 2010-07-28 20:37:40

12eason
Banned
Registered: 2010-07-20
Posts: 103

xrandr startup in xfce

On ubuntu I would put my xrandr configuration in ~/.xprofile and it seemed to fire before the desktop but after X and worked fine, but that doesn't work any more (presumably because I'm not using gdm anymore). I've tried including the script file as a startup application in xfce, but for some reason it doesn't work properly.

Where's the proper place to put stuff like this? Preferably I want it to configure my monitors before the desktop so I don't get any nasty monitor blinking.

Offline

#2 2010-07-28 20:40:00

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: xrandr startup in xfce

The wiki page may reveal some information to you:
http://wiki.archlinux.org/index.php/Xrandr
smile

Offline

#3 2010-07-28 21:00:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: xrandr startup in xfce

You can try putting it in .xinitrc.

Offline

#4 2010-07-28 21:03:54

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

The wiki page may reveal some information to you:
http://wiki.archlinux.org/index.php/Xrandr
smile

hmm, not really.

I don't use gdm or kdm so I can't put the script under /etc/.. and .xprofile is launched by gdm too so I can't use that. I'm using nouveau with kms so I'm not going back to xorg.conf either.

Last edited by 12eason (2010-07-28 21:04:46)

Offline

#5 2010-07-28 21:06:26

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

karol wrote:

You can try putting it in .xinitrc.

I tried sourcing the script in .xinitrc before execing xfce, but that stopped X from starting. Maybe it would work if I just copied and pasted the code in instead.

Last edited by 12eason (2010-07-28 21:07:01)

Offline

#6 2010-07-28 21:06:28

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: xrandr startup in xfce

12eason wrote:

The wiki page may reveal some information to you:
http://wiki.archlinux.org/index.php/Xrandr
smile

hmm, not really.

I don't use gdm or kdm so I can't put the script under /etc/.. and .xprofile is launched by gdm too so I can't use that. I'm using nouveau with kms so I'm not going back to xorg.conf either.

EDIT: Too late tongue

Can you post your .xinitrc?

Last edited by cesura (2010-07-28 21:07:20)

Offline

#7 2010-07-28 21:15:36

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

k, it doesn't work in .xinitrc either. Ends up disabling my secondary and doesn't manage to set the res on the primary properly either.

Can you post your .xinitrc?

sure, it's fairly standard except the stuff I just added.

#!/bin/sh
#
# ~/.xinitrc
#
xrandr --newmode "1280x1024"  108.79  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
xrandr --addmode VGA-1 "1280x1024"
xrandr --output VGA-1 --mode "1280x1024"
xrandr --output DVI-I-1 --preferred
xrandr --output DVI-I-1 --right-of VGA-1

# Executed by startx (run your window manager from here)
# exec xterm
# exec gnome-session
# exec startkde
exec startxfce4
# ...or the Window Manager of your choice

Last edited by 12eason (2010-07-28 21:16:34)

Offline

#8 2010-07-28 21:17:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: xrandr startup in xfce

Put '&' at the end of the the xrandr lines.

Offline

#9 2010-07-28 21:26:32

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: xrandr startup in xfce

karol wrote:

Put '&' at the end of the the xrandr lines.

karol, you beat me to EVERYTHING! tongue

Offline

#10 2010-07-28 21:30:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: xrandr startup in xfce

itsbrad212 wrote:
karol wrote:

Put '&' at the end of the the xrandr lines.

karol, you beat me to EVERYTHING! tongue

Do you have a GF? ;P

Offline

#11 2010-07-28 21:35:49

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

unfortunately, running in the background didn't quite work either. It left the primary in 1024x768. The secondary was positioned correctly, but the screen was still 1440x900 so only a quarter of the secondary was used. [strike] I think it is executing too early.[/strike]

eta; in fact, I think it is executing at the same time as startxfce, so xfce is building the desktop on an out of date screen.

Last edited by 12eason (2010-07-28 21:39:49)

Offline

#12 2010-07-28 21:45:24

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: xrandr startup in xfce

karol wrote:
itsbrad212 wrote:
karol wrote:

Put '&' at the end of the the xrandr lines.

karol, you beat me to EVERYTHING! tongue

Do you have a GF? ;P

You just try and take her away from me! tongue

Anyway, back on topic. Does XFCE have an autostart.sh or something similar, such as Openbox? Also, I suggest using the following line in .xinitrc:

exec ck-launch-session startxfce4

Offline

#13 2010-07-28 21:46:39

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: xrandr startup in xfce

12eason wrote:

eta; in fact, I think it is executing at the same time as startxfce, so xfce is building the desktop on an out of date screen.

You could always add a sleep xxx in between the execution of xrandr and XFCE.

Offline

#14 2010-07-28 21:55:55

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

itsbrad212 wrote:
12eason wrote:

eta; in fact, I think it is executing at the same time as startxfce, so xfce is building the desktop on an out of date screen.

You could always add a sleep xxx in between the execution of xrandr and XFCE.

I think I might end up having to use a while loop to wait for pidof xrandr to disappear. Seems like a hack though and it slows the boot process.

Thanks to you both for your help on this.

Offline

#15 2010-07-28 23:09:13

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: xrandr startup in xfce

Can't you put the script in xfce's autostart list?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#16 2010-07-28 23:17:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Offline

#17 2010-07-28 23:46:29

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

Yeah, i said in the OP I tried as a startup app and it doesn't work for some reason. It's odd because my other startup scripts work fine and fire very late so it really should work.

Offline

#18 2010-07-28 23:48:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: xrandr startup in xfce

Do they all have the right permissions? 'chmod +x'?

Offline

#19 2010-07-28 23:54:02

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

all +x yeah. runs fine when double clicked.

Offline

#20 2010-07-29 00:00:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: xrandr startup in xfce

12eason wrote:

all +x yeah. runs fine when double clicked.

Again: every script in the autorun dir runs fine, but the xrandr one does not, however if you run it by hand, it works. That's kinda impossible.

Offline

#21 2010-07-29 00:13:06

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=monitor setup
Comment=
Exec=/home/user/Scripts/xprofile.sh
StartupNotify=false
Terminal=false
Hidden=false
#!/bin/sh

xrandr --newmode "1280x1024"  108.79  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
xrandr --addmode VGA-1 "1280x1024"
xrandr --output VGA-1 --mode "1280x1024"
xrandr --output DVI-I-1 --preferred
xrandr --output DVI-I-1 --right-of VGA-1

Just refuses to do anything. Even switched the Terminal flag to true and it just opened up a terminal in /home/user/Scripts but didn't execute the xrandr lines.

Offline

#22 2010-07-29 00:22:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: xrandr startup in xfce

Sorry, I'm not familiar w/ .desktop files, but maybe you can try a name w/o a space?

 
Name=monitor setup

Offline

#23 2010-07-29 00:39:26

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

That's only a friendly name, doesn't affect it as others are like it and run. I just tried the method shown here; http://www.thinkwiki.org/wiki/Xorg_Rand … .24_xrandr using 45custom_xrandr-settings and not even that works.

Last edited by 12eason (2010-07-29 00:39:48)

Offline

#24 2010-07-29 09:12:05

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: xrandr startup in xfce

12eason wrote:

I just tried the method shown here; http://www.thinkwiki.org/wiki/Xorg_Rand … .24_xrandr using 45custom_xrandr-settings and not even that works.

k, so I did some googling and found xinit/xinitrc.d is Archs version of Xsession.d, but as others have noted, nothing under xinit.d seems to execute either. I'm thinking maybe arch executes ~/.xinitrc first and the exec to xfce disrupts the following execution of etc/xinit/xinitrc.d scripts?

This is proving to be a real pita.

Offline

#25 2010-07-29 09:17:21

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: xrandr startup in xfce

Do a simple test, create a script with 'env > /tmp/env.dump' and check inside if the DISPLAY variable is set, you can also redirect all the output of xrandr to a file and check why it isn't working, I'm sure it is complaining about something.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB