diff --git a/README.md b/README.md index aac9c87..1632a78 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,15 @@ Extend it to the right: disport --extend right +Extend it above: + + disport --extend above + +Extend it below: + + disport --extend below + + ## To-do * Let the user specify the display for the restrict mode diff --git a/disport/disport.py b/disport/disport.py index a14e2f6..356e1a1 100644 --- a/disport/disport.py +++ b/disport/disport.py @@ -113,13 +113,17 @@ def extend_output(self, direction): sys.exit(1) else: # Normalize direction - if direction in ("right", "r"): - direction = "right" - elif direction in ("left", "l"): - direction = "left" + if direction in ("right-of", "right", "r"): + direction = "right-of" + elif direction in ("left-of", "left", "l"): + direction = "left-of" + elif direction in ("above", "a"): + direction = "above" + elif direction in ("below", "b"): + direction = "below" else: print("Unknown direction:", direction) - print("Choose either l (left) or r (right).") + print("Choose either l (left), r (right), a (above) or b (below).") sys.exit(1) # Set output for built-in display cmd = Command("xrandr") @@ -133,7 +137,7 @@ def extend_output(self, direction): cmd += "--output " + str(disp) cmd += "--auto" cmd += "--rotate normal" - cmd += "--" + direction + "-of " + str(prev) + cmd += "--" + direction + " " + str(prev) prev = disp cmd.call() self.print_status("Extended output.")