Hey, On Tue, Mar 22, 2011 at 01:13:54AM +0300, Dmitry V. Levin wrote: > On Mon, Mar 21, 2011 at 10:42:36PM +0100, Michael Schutte wrote: > > The console-setup package in Debian needs a way to check for the > > text/graphics mode of the active VT (from a shell script). This can be > > done with “setfont -v -o /dev/null”, for example, but that isn’t very > > elegant. Julien Cristau has proposed a small utility (which I’m calling > > “vt_mode” for now) to report this information in a canonical fashion. > > I wonder whether you actually need to know what's the KD_ mode, or > maybe your scripts just need yes/no answers on simple two questions: > - whether the active VT is in the text mode? > - whether the active VT is in the graphics mode? > > In the latter case, I suggest to implement an utility with an option or > argument specifying what mode to query, and a tty(1)-like exit status, > so its use would be as simple as "if vt_mode text; then ...; fi". Yes, that would certainly work as well; it could even do both things, depending on the presence of an argument. I don’t really care either way (it isn’t even my script, I’m just relaying for the console-setup developers). I just figured it would make sense to stick to the way kbd_mode works. 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