summaryrefslogtreecommitdiffstats
path: root/examples/sleepmode
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-23 17:49:30 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-23 17:49:30 +0100
commit71f64125e8f66cf0e504c8b35f7ab89f22765ae4 (patch)
treed524163236bd911b9113843a0eabafbbc17801d2 /examples/sleepmode
parenttypo (diff)
downloadblueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.gz
blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.bz2
blueshift-71f64125e8f66cf0e504c8b35f7ab89f22765ae4.tar.xz
fix errors in getting current curves + add getting curent curves to tests + fix multimonitor mistakes in examples
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples/sleepmode')
-rw-r--r--examples/sleepmode8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/sleepmode b/examples/sleepmode
index 44695a3..a5b3023 100644
--- a/examples/sleepmode
+++ b/examples/sleepmode
@@ -79,7 +79,7 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
(**) See https://en.wikipedia.org/wiki/Leap_second
'''
purity = 0 if fade is None else 1 - abs(fade)
- for m in [0] if len(monitors) == 0 else monitors:
+ for m in max(1, len(monitors)):
# Remove settings from last run.
start_over()
@@ -103,14 +103,14 @@ def periodically(year, month, day, hour, minute, second, weekday, fade):
if len(monitors) == 0:
randr()
else:
- randr(m)
+ randr(monitors[m % len(monitors)])
def reset():
'''
Invoked to reset the displays
'''
- for m in [0] if len(monitors) == 0 else monitors:
+ for m in max(1, len(monitors)):
# Remove settings from last run.
start_over()
@@ -124,5 +124,5 @@ def reset():
if len(monitors) == 0:
randr()
else:
- randr(m)
+ randr(monitors[m % len(monitors)])