This repository has been archived on 2022-03-04. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/scripts/.local/bin/workspace-switcher

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}")