Skip to content

Commit

Permalink
Linux fixes to emrun. Don't fail if glxinfo is not installed, and loo…
Browse files Browse the repository at this point in the history
…k for Chrome in 'google-chrome' executable name as well. Don't fail if browser is not found.
  • Loading branch information
juj committed Jan 3, 2014
1 parent cc616ed commit a639bce
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions emrun
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,18 @@ def win_print_gpu_info():
print "GPU"+str(i)+ ": " + gpus[i] + " with " + gpu_memory[i] + " MBs of VRAM"

def linux_print_gpu_info():
glxinfo = subprocess.check_output('glxinfo')
for line in glxinfo.split("\n"):
if "OpenGL vendor string:" in line:
gl_vendor = line[len("OpenGL vendor string:"):].strip()
if "OpenGL version string:" in line:
gl_version = line[len("OpenGL version string:"):].strip()
if "OpenGL renderer string:" in line:
gl_renderer = line[len("OpenGL renderer string:"):].strip()
logi('GPU: ' + gl_vendor + ' ' + gl_renderer + ', GL version ' + gl_version)
try:
glxinfo = subprocess.check_output('glxinfo')
for line in glxinfo.split("\n"):
if "OpenGL vendor string:" in line:
gl_vendor = line[len("OpenGL vendor string:"):].strip()
if "OpenGL version string:" in line:
gl_version = line[len("OpenGL version string:"):].strip()
if "OpenGL renderer string:" in line:
gl_renderer = line[len("OpenGL renderer string:"):].strip()
logi('GPU: ' + gl_vendor + ' ' + gl_renderer + ', GL version ' + gl_version)
except:
pass

def osx_print_gpu_info():
try:
Expand Down Expand Up @@ -722,11 +725,12 @@ def find_browser(name):
('firefox_beta', os.path.expanduser('~/firefox_beta/firefox')),
('firefox_aurora', os.path.expanduser('~/firefox_aurora/firefox')),
('firefox_nightly', os.path.expanduser('~/firefox_nightly/firefox')),
('chrome', which('google-chrome-stable'))]
('chrome', which('google-chrome-stable')),
('chrome', which('google-chrome'))]

for (alias, browser_exe) in browser_locations:
if name == alias:
if os.path.isfile(browser_exe):
if browser_exe is not None and os.path.isfile(browser_exe):
return [browser_exe]

return None # Could not find the browser
Expand Down

0 comments on commit a639bce

Please sign in to comment.