LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-05-2005, 03:12 PM   #1
caspian
LQ Newbie
 
Registered: Mar 2005
Posts: 4

Rep: Reputation: 0
Problem with "xrandr"


I'm editing my /etc/acpi/sleep.sh script to change my screen resolution when I suspend (My graphics card gets unhappy unless I change my screen resolution before I suspend)

The following command works fine:
Code:
xrandr -s 1
But when I'm root, I get this error:
Quote:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Can't open display (null)
Is there something I'm doing wrong? Or, is there a better command to use other than xrandr?

Thanks.
 
Old 08-06-2005, 09:24 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
it's not root's xserver, it's your users. don't run it as someone who doesn't own the server.
 
Old 08-08-2005, 01:59 PM   #3
caspian
LQ Newbie
 
Registered: Mar 2005
Posts: 4

Original Poster
Rep: Reputation: 0
I would run xrandr as my normal user, except that when I run /etc/acpi/sleep.sh, I need to be root. "sudo -u {username} xrandr..." doesn't work either.

Is there a better way to do this other than using xrandr?
 
Old 01-03-2008, 03:47 AM   #4
choffee
LQ Newbie
 
Registered: Apr 2005
Posts: 1

Rep: Reputation: 0
Setting display and Xauth

if you run the following befor xrandr it should work.

export DISPLAY=:0
export XAUTHORITY=/home/<user>/.Xauthority

Replacing <user> with your user. You could even do some checking to see which user is logged in to X and set it that way but it's only me that uses this computer so that's okay for me.

Then when you run xrandr it knows to talk to the local display 0 and use your Xauthority to authenticate.

Works for me anyway.
 
Old 01-03-2008, 03:48 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
why did you reply to a thread that hadn't been touched for over 2 years?? please don't.
 
Old 05-13-2009, 09:08 AM   #6
m_runwal
LQ Newbie
 
Registered: Mar 2007
Posts: 8

Rep: Reputation: 0
Wink I also have similar problem

I also had similar problem.
1. I tried to connect from another machine and try to use the command
xrandr -o normal
but got same error as specified earlier.

so I did one trick. I hope this might help you guys.
I had problem when I tried to login with GNOME. screen led blinks.
Then you have to Press ALT+F2 this will bring up Run command (though nothing will be seen on screen.) and type without making any spelling error.

Code:
xrand -o normal
This bring back screen to normal.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Debian Boot Up Problem - stuck at "BR" & "I" jc70417 Debian 2 08-30-2005 04:36 PM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM
Sound problem with "alsamixer" or "alsaconf" or sth else maybe... Mikuda Linux - Games 4 05-01-2004 11:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration