You are not logged in.

#1 2015-11-22 13:24:28

Linux-Joker
Member
Registered: 2015-11-22
Posts: 17

problems with xrandr on boot

I want to configure my 2 external screens of my laptop on every startup.
Because I have a kind of dockstation I wrote a small script which retrieves whether my laptop is connected to the dock or not.

If yes the monitors should configure themselfs by xrandr. Here is my script:

#!/bin/bash

export DISPLAY=:0
export XAUTHORITY=/home/$USER/.Xauthority

sleep 1

DOCKED=$(cat /sys/devices/platform/dock.2/docked)
case "$DOCKED" in
0)
xrandr --output DVI1 --off --output VIRTUAL1 --off --output VGA1 --off &> && xrandr --output LVDS1 --mode 1024x768 --pos 0x0 --rotate normal
;;
1)
xrandr --output VIRTUAL1 --off --output LVDS1 --off && xrandr --output DVI1 --mode 1366x768 --pos 1360x0 --rotate normal --output VGA1 --primary --mode 1360x768 --pos 0x0 --rotate normal
;;
esac

Unfortunately xrand does not work in the right way on boot. It shows me this:

xrandr: cannot find mode 1360x768

I am a little bit confused because if I start the script while my pc is already running it works flawless and there is no error report!

So I guess xrandr does not find my monitors on startup and therefore it does not know the specific configuration of each of them..

How can I fix this issue??

Thanks a lot for helping me!

Offline

#2 2015-11-22 13:42:58

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: problems with xrandr on boot

How are you running your script?

If it's automatically running before x has started then it's not going to work.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2015-11-22 14:57:45

Linux-Joker
Member
Registered: 2015-11-22
Posts: 17

Re: problems with xrandr on boot

I run as a tiling manager: i3

Therefore I use the build-in config file of i3 to autostart programs or scripts.

On other computers I use i3 as well and there I use xrandr to configure the monitors. But only with this script on my laptop with my dockingstation I get errors like this..

Offline

#4 2015-11-22 17:03:05

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: problems with xrandr on boot

Linux-Joker wrote:
xrandr: cannot find mode 1360x768

Does your VGA1 really support 1360x 768? or is that a typo?

What native modes does xrandr tell you that VGA1 supports when you enable it?

Offline

#5 2015-11-22 19:10:09

Linux-Joker
Member
Registered: 2015-11-22
Posts: 17

Re: problems with xrandr on boot

satanselbow wrote:
Linux-Joker wrote:
xrandr: cannot find mode 1360x768

Does your VGA1 really support 1360x 768? or is that a typo?

What native modes does xrandr tell you that VGA1 supports when you enable it?

I checked this, but it seems to be right:

VGA1 connected primary 1360x768+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm
   1920x1080     60.00 +
   1280x1024     60.02  
   1360x768      60.02* 
   1024x768      60.00  
   800x600       60.32  
   640x480       60.00    59.94  
   720x400       70.08  

Offline

#6 2015-11-22 19:59:25

c0mm0ner
Member
Registered: 2015-11-09
Posts: 93

Re: problems with xrandr on boot

if it works while your system is running, just start the script via .xinitrc or i3 autostart as a workaround.

Offline

#7 2015-11-22 21:07:23

Dude-man
Member
Registered: 2012-11-17
Posts: 43

Re: problems with xrandr on boot

I think i've seen this posted as a problem, unsolved and specific to i3... sorry don't know where it was.

I "Solved" it by defining a keyboard short cut which set/changes calls xrandr... a good few seconds after X startup.

Offline

#8 2015-11-23 11:49:39

Linux-Joker
Member
Registered: 2015-11-22
Posts: 17

Re: problems with xrandr on boot

Okay thanks for the answers! I try to check it out whether on of the ideas works. I will report soon.

Offline

Board footer

Powered by FluxBB