summaryrefslogtreecommitdiff
path: root/monitor-menu.py
diff options
context:
space:
mode:
Diffstat (limited to 'monitor-menu.py')
-rwxr-xr-xmonitor-menu.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/monitor-menu.py b/monitor-menu.py
index 6e07155..64a6753 100755
--- a/monitor-menu.py
+++ b/monitor-menu.py
@@ -18,12 +18,12 @@ import subprocess
import dialog
import docopt
-d = dialog.Dialog()
class MonitorMenu():
def __init__(self, config_file='~/.config/monitor-profiles.json'):
with open(expanduser(config_file)) as fh:
self.profiles = json.load(fh)
+ self.d = dialog.Dialog()
def run(self, profile_idx=None):
choices = []
@@ -34,9 +34,11 @@ class MonitorMenu():
choices.append((str(i), p['name']))
i += 1
- code, profile_idx = d.menu('Select the profile you want to use.', choices=choices)
+ code, profile_idx = self.d.menu(
+ 'Select the profile you want to use.',
+ choices=choices)
- if code in (d.ESC, d.CANCEL):
+ if code in (self.d.ESC, self.d.CANCEL):
return
profile = self.profiles[int(profile_idx)]