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.

31 lines
631 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"])
  18. if len(sys.argv)>2:
  19. if sys.argv[2] == "4k":
  20. print("4k")
  21. # xrandr --output HDMI-2 --mode 3840x2160
  22. subprocess.run(["xrandr", "--output", d[1], "--mode", "3840x2160"])