From owner-freebsd-questions Sat Aug 18 11:13:45 2001 Delivered-To: freebsd-questions@freebsd.org Received: from chmls06.mediaone.net (chmls06.mediaone.net [24.147.1.144]) by hub.freebsd.org (Postfix) with ESMTP id 011BF37B409 for ; Sat, 18 Aug 2001 11:13:41 -0700 (PDT) (envelope-from leblanc@smtp.ne.mediaone.net) Received: from canada.acadia.ne.mediaone.net (acadia.ne.mediaone.net [65.96.185.189]) by chmls06.mediaone.net (8.11.1/8.11.1) with ESMTP id f7IIDam27361 for ; Sat, 18 Aug 2001 14:13:36 -0400 (EDT) Received: (from leblanc@localhost) by canada.acadia.ne.mediaone.net (8.11.5/8.11.5) id f7II7CR80048; Sat, 18 Aug 2001 14:07:12 -0400 (EDT) (envelope-from leblanc) Date: Sat, 18 Aug 2001 14:07:12 -0400 From: Louis LeBlanc To: freebsd-questions@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG Subject: Re: Opening root-windows on userX' display. Message-ID: <20010818140711.A79888@acadia.ne.mediaone.net> Reply-To: freebsd-questions@FreeBSD.ORG Mail-Followup-To: freebsd-questions@FreeBSD.ORG References: <20010817083259.HICK449.fepA.post.tele.dk@there> <01081723181802.00504@roc-24-169-96-227.rochester.rr.com> <20010818053425.CCFQ14731.fepZ.post.tele.dk@there> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20010818053425.CCFQ14731.fepZ.post.tele.dk@there> User-Agent: Mutt/1.3.20i X-bright-idea: Lets abolish HTML mail! Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 08/18/01 07:36 AM, Bjarne Wichmann Petersen sat at the `puter and typed: > On Saturday 18 August 2001 05:18, Justin C Sherrill wrote: > > > I don't know if it's the correct way to do it, but typing "+xhost > > 127.0.0.1" in a terminal window, and then su'ing to root, seems to allow me > > to then launch X apps as root. It just worked now launching an Xterm as > > root, though I'm logged into XWindows as non-root. > > Hey, that works too. But it needs a running X-session and thus there doesn't > seems to be a way to do this automatically? > > Bjarne > I added the following to my personal .xsession file: xhost localhost Then add some environment variable testing to the root init scripts (.bash_profile, .profile, whatever) so that if it doesn't get a DISPLAY setting from its invoking shell (via exported DISPLAY setting), it is automatically set to ":0.0". Then you needn't bother with xhost settings, DISPLAY settings, etc. I use the following in my ~root/.bash_profile # Set DISPLAY if we don't already have it. if [ -z "$DISPLAY" ]; then DISPLAY=127.0.0.1:0.0 export DISPLAY fi Works fine. HTH Lou -- Louis LeBlanc leblanc@acadia.ne.mediaone.net Fully Funded Hobbyist, KeySlapper Extrordinaire :) http://acadia.ne.mediaone.net ԿԬ tax office, n.: Den of inequity. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message