/* u1zoom - sjb (ottaky@ottaky.com) - 30/07/2002 - cycle through available X modes using the Zoom button on the Sony Vaio U1 This program requires the sonypi module to be loaded, and that you have correctly configured /dev/sonypi. Th4nks and gr33ts to Henrik Jonsson and his l33t C sk1llz, without whoM I would still be struggling to get this to compile. */ #include #include #include #include int main () { char mychar; FILE *file; if ((file = fopen("/dev/sonypi","r")) == NULL) { fprintf(stderr, "Unable to open sonypi, %s", "file"); exit(1); } while (mychar = getc(file)) { if (mychar == '(') { Display * pDisplay = XOpenDisplay("localhost:0"); if (pDisplay == NULL) { fprintf (stderr, "unable to open display"); exit(1); } if (XF86VidModeSelectNextMode(pDisplay, 0)) { } XCloseDisplay(pDisplay); } } return 0; }