From 8278e7c5a17c27a2fbba637a687455b59bf6e01c Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Tue, 21 Apr 2020 20:30:44 +0200 Subject: [PATCH] [modules/prime] quotes --- modules/contrib/prime.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/contrib/prime.py b/modules/contrib/prime.py index 542ae20..f9bb0e7 100644 --- a/modules/contrib/prime.py +++ b/modules/contrib/prime.py @@ -17,8 +17,8 @@ Then put a line like this in there: If you can't figure out the sudoers thing, then don't worry, it's still really useful. Parameters: - * prime.nvidiastring: String to use when nvidia is selected (defaults to "intel") - * prime.intelstring: String to use when intel is selected (defaults to "intel") + * prime.nvidiastring: String to use when nvidia is selected (defaults to 'intel') + * prime.intelstring: String to use when intel is selected (defaults to 'intel') Requires the following executable: * prime-select @@ -40,30 +40,30 @@ class Module(bumblebee.engine.Module): engine.input.register_callback(self, button=bumblebee.input.RIGHT_MOUSE, cmd=self._chooseIntel) - self.nvidiastring = self.parameter("nvidiastring", "nv") - self.intelstring = self.parameter("intelstring", "it") + self.nvidiastring = self.parameter('nvidiastring', 'nv') + self.intelstring = self.parameter('intelstring', 'it') def _chooseNvidia(self, event): - bumblebee.util.execute("sudo prime-select nvidia") + bumblebee.util.execute('sudo prime-select nvidia') def _chooseIntel(self, event): - bumblebee.util.execute("sudo prime-select intel") + bumblebee.util.execute('sudo prime-select intel') def _prev_keymap(self, event): self._set_keymap(-1) def query(self, widget): try: - res = bumblebee.util.execute("prime-select query") + res = bumblebee.util.execute('prime-select query') except RuntimeError: - return "n/a" + return 'n/a' - for line in res.split("\n"): + for line in res.split('\n'): if not line: continue - if "nvidia" in line: + if 'nvidia' in line: return self.nvidiastring - if "intel" in line: + if 'intel' in line: return self.intelstring - return "n/a" + return 'n/a' # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4