Skip to content

Commit

Permalink
Change 'forced' global variable to 'skip_prime_support'
Browse files Browse the repository at this point in the history
`skip_prime_support` more clearly described the purpose of this global variable. Useful while testing.
  • Loading branch information
flexiondotorg committed Sep 8, 2019
1 parent f66ad2c commit 2193a30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions usr/bin/mate-optimus-applet
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ __VERSION__ = '19.10.3'

# i18n
gettext.install("mate-optimus", "/usr/share/locale")
forced = False
skip_prime_support = False

def get_active_gpu():
process = subprocess.Popen(['prime-select', 'query'], stdout=PIPE)
Expand All @@ -41,8 +41,8 @@ def has_nvidia_settings():
return False

def prime_capable():
if forced:
print(' - prime-supported: Forced mode, skipping')
if skip_prime_support:
print(' - prime-supported: Skipping.')
return True

prime_supported = subprocess.Popen(['prime-supported'], stdout=PIPE, stderr=DEVNULL)
Expand Down Expand Up @@ -321,7 +321,7 @@ if __name__ == "__main__":
setproctitle.setproctitle(executable)
print(executable + ': launched.')

if (prime_capable() and has_nvidia_settings()) or forced:
if (prime_capable() and has_nvidia_settings()) or skip_prime_support:
print(executable + ': NVIDIA Optimus supported.')
if executable == 'mate-optimus-applet':
Indicator()
Expand Down

0 comments on commit 2193a30

Please sign in to comment.