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.
 
 
 
 
 
 

36 lines
774 B

#!/usr/bin/env python3
import os
import subprocess
import sys
print(sys.argv[1])
setup = sys.argv[1]
subprocess.run(["xrandr", "--auto"])
d = os.popen("xrandr --listmonitors | grep '+' | awk {'print $4'}").read().splitlines()
print(d[1])
pos = "--above"
if setup == "h":
pos="--right-of"
elif setup == "ih":
pos="--left-of"
elif setup == "v":
pos="--above"
elif setup=="mirror":
pos="--same-as"
subprocess.run(["xrandr", "--output", d[1], pos, "eDP-1"])
if len(sys.argv)>2:
if sys.argv[2] == "4k":
print("4k")
# xrandr --output HDMI-2 --mode 3840x2160
subprocess.run(["xrandr", "--output", d[1], "--mode", "3840x2160"])
# restart i3 status bar to avoid being frozen
subprocess.run(["i3-msg", "restart"])