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