From: Antonino A. D. <ad...@ho...> - 2004-09-04 23:40:34
|
On Friday 03 September 2004 23:09, ro...@ub... wrote: > Hello. > > How can I determine whether a script is being run > from a frame buffer console? > > I need this information in order to choose the > correct arguments when calling a program from > my script. > You can parse /proc/fb to find out if any framebuffer drivers are loaded, then do an ioctl where request is FBIO_GET_CON2FBMAP, and struct fb_con2fbmap.console is set to the console number you want to determine. If successful, check fb_con2fbmap.framebuffer on return. Valid values are from 0 to (FB_MAX - 1) where FB_MAX is the number of framebuffer drivers configured in your system In 2.6, an unmapped console will return fb_con2fbmap.framebuffer = -1. In 2.4, I'm not sure, but it's possible that it can be undefined. Tony |