Gentoo Archives: gentoo-user

From: Richard Fish <bigfish@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] xrandr rotation
Date: Sat, 01 Oct 2005 19:30:30
Message-Id: 433EE2DA.4070303@asmallpond.org
In Reply to: [gentoo-user] xrandr rotation by wOmbad
1 wOmbad wrote:
2
3 > Hi
4 >
5 > Rotatin my desktop orientation via the xrandr command (p.e. xrandr -o
6 > left) works perfectly from a konsol within the running kde-3.4.2!
7 > Unfortunately the equivalent command - xrandr -display :0.0 -o left -
8 > from a virtual terminal strikes with the following output message:
9 >
10 > Xlib: connection to ":0.0" refused by server
11 > Xlib: No protocol specified
12 >
13 > kwin: can't connect to X server :0.0
14 >
15 > Obviously there is a Xserver running with the specified displayname.
16 > The "-(-)display"-option of serveral commands(like kwin, etc.) refused
17 > to work as well with almost the same error.
18 >
19 > I think it's a problem with my xserver config but sadly i haven't found
20 > a solution on the internet.
21
22
23 Nothing to do with your xorg.conf, but with the X security mechanisms.
24
25 By default X uses magic cookies to authenticate clients...any client
26 that knows the magic password can access the display.
27
28 One of the jobs of kdm is that once you have logged into the display, it
29 creates ~/.Xauthority so that the programs that are run under your login
30 know the password. But it only does this _after_ you login. While the
31 login window is displayed, the magic file is /var/run/xauth/A:0-??????,
32 and is owned by root.
33
34 So to run an xclient (like xrandr, xlogo, or xconsole), you need to
35 point them to the correct xauthority file, and also run them as root.
36 The tricky part is that the name of the file changes each time kdm is
37 run. The following commands, run as root, should do the trick though:
38
39 export XAUTHORITY=/var/run/xauth/`ls -rt /var/run/xauth/ | tail -n 1`
40 xlogo -display :0
41
42 You can replace xlogo with xrandr or any other client you want to run.
43
44 If this seems like too much work, you can add a "xhost localhost" to
45 /usr/kde/3.4/share/config/kdm/Xsetup, but then you have no security at
46 all for locally run clients.
47
48 All of this only applies if you are using kdm as your login manager. If
49 you are using gdm, xdm, or another login manager, you'll have to figure
50 out how they handle xauth security.
51
52 Anyway, you may want to read up on the ACCESS CONTROL section in the X
53 man page, or read the Xsecurity man page.
54
55 HTH,
56 -Richard
57
58 --
59 gentoo-user@g.o mailing list