You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
435 B

  1. #!/usr/bin/env python3
  2. import os
  3. import subprocess
  4. import sys
  5. print(sys.argv[1])
  6. setup = sys.argv[1]
  7. subprocess.run(["xrandr", "--auto"])
  8. d = os.popen("xrandr --listmonitors | grep '+' | awk {'print $4'}").read().splitlines()
  9. print(d[1])
  10. pos = "--above"
  11. if setup == "h":
  12. pos="--right-of"
  13. elif setup == "ih":
  14. pos="--left-of"
  15. elif setup == "v":
  16. pos="--above"
  17. subprocess.run(["xrandr", "--output", d[1], pos, "eDP-1"])