20 lines
368 B
Python
Executable File
20 lines
368 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
from i3ipc import Connection
|
|
|
|
i3 = Connection()
|
|
ws = i3.get_workspaces()
|
|
|
|
for w in ws:
|
|
if w.focused == True:
|
|
current = w
|
|
|
|
if sys.argv[1] == "next":
|
|
i3.command(f"workspace {current.num + 1}")
|
|
elif sys.argv[1] == "prev":
|
|
if current.num == 1:
|
|
pass
|
|
else:
|
|
i3.command(f"workspace {current.num - 1}")
|