#!/bin/sh XGL=no COMPIZ=no # auto-start Xgl if direct rendering is available # and GLX_EXT_texture_from_pixmap is not available in server GLX extensions # (displayed before client glx extensions by glxinfo) glxinfo 2>/dev/null | awk 'BEGIN { no_direct = 1; in_client = 0; server_tfp = 0; client_tfp = 0 } /direct rendering: Yes/ { no_direct = 0 } /GLX_EXT_texture_from_pixmap/ { if (in_client) { client_tfp = 1 } else { server_tfp = 1 } } /client glx extensions:/ { in_client = 1 } /GLX extensions/ { exit } END { exit or(no_direct, and(server_tfp, client_tfp)) }' && XGL=yes # auto-start compiz if direct rendering and GLX_EXT_texture_from_pixmap are available source /etc/init.d/functions if [ "$XGL" = "yes" ] || pidof Xgl >/dev/null 2>&1; then COMPIZ=yes elif glxinfo 2>/dev/null | awk 'BEGIN { no_direct = 1; no_tfp = 1 } /direct rendering: Yes/ { no_direct = 0 } /GLX_EXT_texture_from_pixmap/ { no_tfp = 0 } END { exit or(no_direct, no_tfp) }'; then COMPIZ=yes fi echo "Xgl auto: $XGL" echo "Compiz auto: $COMPIZ"