add multihead workspace switching script for swaywm
This commit is contained in:
parent
bf14910fc8
commit
70b4f40bec
12
.local/bin/switchws.py
Executable file
12
.local/bin/switchws.py
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import json,sys,subprocess
|
||||
|
||||
args = sys.argv
|
||||
msg = json.loads(subprocess.run(["swaymsg", "-t", "get_workspaces"], stdout=subprocess.PIPE).stdout.decode('utf-8'))
|
||||
for i in range(len(msg)):
|
||||
if msg[i]["focused"] == True:
|
||||
if msg[i]["output"] == "DP-1":
|
||||
subprocess.run(["swaymsg", "workspace", str(args[1])])
|
||||
if msg[i]["output"] == "DVI-D-1":
|
||||
subprocess.run(["swaymsg", "workspace", "P" + str(args[1])])
|
Loading…
Reference in New Issue
Block a user