quake-style console with xterm

Default to calculating window height by screen size

+7 -2
+7 -2
qconsole.c
··· 47 47 48 48 #define MAX_SPEED 10 49 49 #define DEF_SPEED 7 50 - #define DEF_HEIGHT 157 51 50 52 51 #define BORDER 4 53 52 ··· 96 95 int ch; 97 96 98 97 memset(&main_win, 0, sizeof(struct xinfo)); 99 - main_win.height = DEF_HEIGHT; 100 98 main_win.speed = DEF_SPEED; 101 99 main_win.cur_direction = DIR_UP; 100 + 101 + /* will get set according to screen height if not overridden by -h */ 102 + main_win.height = 0; 102 103 103 104 while ((ch = getopt(argc, argv, "dh:s:")) != -1) 104 105 switch (ch) { ··· 196 197 errx(1, "Unable to open display %s", XDisplayName(display)); 197 198 198 199 XSetErrorHandler ((XErrorHandler) x_error_handler); 200 + 201 + if (main_win.height == 0) 202 + main_win.height = DisplayHeight(main_win.dpy, 203 + main_win.screen) / 5; 199 204 200 205 main_win.screen = DefaultScreen(main_win.dpy); 201 206 main_win.width = main_win.dpy_width = DisplayWidth(main_win.dpy,