arnaucube
arnaucube/configsPublic Self-hosted repository
Add bin/ screens & movetosecondaryscreen scripts
arnaucube root@arnaucube.com
Fri, 25 Jun 2021 16:40:11 +0200
commit

a671b13e0b7a1245152caeb7b8d9432ba3ad6ee3

parent

339c76a3d8b4bb3e03a4de0e4c96200245e802b3

2 files changed, 31 insertions(+), 0 deletions(-)

jump to
A bin/movetosecondaryscreen

@@ -0,0 +1,7 @@

+#!/usr/bin/env python3 + +import os +import subprocess + +d = os.popen("xrandr --listmonitors | grep '+' | awk {'print $4'}").read().splitlines() +subprocess.run(["i3-msg", "move", "workspace", "to", "output", d[1]])
A bin/screens

@@ -0,0 +1,24 @@

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