[Pkg-kbd-devel] Bug#618573: Needed some way to test whether we are on the console

Michael Schutte michi at debian.org
Thu Mar 17 19:43:27 UTC 2011


Hi Anton,
hi Julien,

On Wed, Mar 16, 2011 at 06:08:10PM +0200, Anton Zinoviev wrote:
> Console-setup needs some way to test whether we are on the console or 
> not (in order not to damage a running X).  Because of Debconf this 
> should work when the program is detached from the actual virtual 
> terminal (so /usr/bin/tty doesn't work).
> 
> For FreeBSD I found the following solution in the net 
> (http://www.opennet.ru/tips/info/1448.shtml, in Russian language):
> 
> if vidcontrol -i adapter >&- 2>&-; then
>    echo We are on the console
> else
>    echo We are not on the console.
> fi
> 
> (Vidcontrol is the FreeBSD analogue of the setfont+fbset combination.)
> 
> Unfortunately I don't know if something similar can work for Linux but 
> Julien Cristau contributed the following code:
> 
> […]
> 
> Would it be possible to include something like this in kbd?  I don't 
> like the idea to include a binary Linux-only utility in an architecture 
> independent package such as console-setup.

It’s rather ugly, but can you confirm that

  # setfont -v -o /dev/null

gives you the necessary information?

I agree that a dedicated utility for this purpose would be nice to have,
although I don’t want to carry it around in the .debian.tar.gz.  Julien,
would you be okay with integrating your little program into kbd
upstream?  I’d just change it to use the getfd() function like the rest
of the tools before submitting it.

Cheers,
-- 
Michael Schutte                   | michi@{uiae.at,debian.org}
Innsbruck, Austria                | happily accepting encrypted mail
OpenPGP: 0x16fb 517b a866 c3f6 8f11 1485 f3e4 122f 1D8C 261A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-kbd-devel/attachments/20110317/b9ab1eae/attachment.pgp>


More information about the Pkg-kbd-devel mailing list