From owner-freebsd-stable@FreeBSD.ORG Thu May 11 23:00:52 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58A6016A5DE for ; Thu, 11 May 2006 23:00:52 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 348E044064 for ; Thu, 11 May 2006 22:30:39 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.4) id k4BMUd6j008292; Thu, 11 May 2006 17:30:39 -0500 (CDT) (envelope-from dan) Date: Thu, 11 May 2006 17:30:39 -0500 From: Dan Nelson To: Nik Clayton Message-ID: <20060511223038.GF76653@dan.emsphone.com> References: <44630A5B.2030906@ngo.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44630A5B.2030906@ngo.org.uk> X-OS: FreeBSD 5.5-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.11 Cc: stable@freebsd.org Subject: Re: Switching virtual consoles from within X X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 May 2006 23:01:23 -0000 In the last episode (May 11), Nik Clayton said: > Is it possible to (from the command line) switch virtual consoles while > within X? > > Since I upgraded X on my laptop resume from suspend has been a little > flaky. But if I make sure I run 'zzz' from within a text virtual terminal > the laptop has (so far) always resumed correctly. > > I could create ~/bin/zzz which checks to see if I'm in X and refuses to > run, but it would be even nicer if I could have it automatically switch to > a virtual console for me, and then run /usr/sbin/zzz. > > I'm aware of 'vidcontrol -s ', and if I run that from a virtual terminal > it works. However, if I run it within X it refuses to work, printing: > > vidcontrol: must be on a virtual console: Inappropriate ioctl for device > > Is there a way around this restriction? Redirect stdin from a vty: vidcontrol -s 1 < /dev/ttyv0 If you're not root you'll either need to specify a vty you are logged in on, or wrap it in a sudo call. -- Dan Nelson dnelson@allantgroup.com