Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions disport/disport.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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.")
Expand Down