Files
configs/bin/screens
arnaucube 045df5631c Add nvim Sage syntax highligting & minor updates
- Add nvim Sage syntax highligting
- Update installer node for v16
- Update i3 config to restart status bar to avoid problems when
extending screens to hdmi
2021-12-08 16:46:04 +01:00

35 lines
732 B
Python
Executable File

#!/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"
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"])