Jump to content

[SOLVED] Force GUI resolution on start-up


Recommended Posts

Hi all,

 

I know this is kind of a niche thing and doesn't qualify for a feature request.

 

I'm trying to get unRIAD to start the X server with a specific resolution or set the res. by script after start. I have been digging into the startup scripts for X and slim the windows manager unRIAD uses.
Here is my go file:

 

#set display reslolution for a decent update speed

cp /boot/config/X/.Xauthority /root/

export DISPLAY=:0.0
export XAUTHORITY=~/.Xauthority


xhost +


xrandr -display :0.0 -s 5


I also wrote a script to change the resolution on array start:

 

#!/bin/bash

telnet localhost

touch ~/.Xauthority

export DISPLAY=:0.0
export XAUTHORITY=~/.Xauthority

xhost +

echo "xrandr -display :0.0 -s 5" | at NOW + 2 min

xauth info

xhost +si:localuser:root

xauth info

xrandr -display :0.0 -s 5

sleep 10

xrandr -display :0.0 -q

This results in a "protocol error". I think it is because there is no entry in .Xauthority for localhost and I don't know how to generate one automatically. if I run xhost + from remote over ssh, the entry is added and everything is good. But localhost doesn't have the authority  to run xhost + by itself.I know there are unnecessary bits in the script, but I just threw them in for testing.

 

I'm assuming there are a couple of different ways to go about this.

 

Link to comment
  • Jagadguru changed the title to [SOLVED] Force GUI resolution on start-up

Solved by changing  the line export XAUTHORITY=~/.Xauthority to 

export XAUTHORITY=/var/run/slim.auth

The login screen is not the right resolution, so I can't see the username/password box, but hey it's pretty good. The session is in the right resolution.

Edited by Jagadguru
correction
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...