Skip to content

Instantly share code, notes, and snippets.

View gorsheninmv's full-sized avatar

Misha Gorshenin gorsheninmv

View GitHub Profile
@SidharthArya
SidharthArya / alttab
Last active October 25, 2024 18:11
Sway Windows Manager Alt Tab behavior
#!/usr/bin/env python3
import sys
import json
import subprocess
direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T')
swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE)
data = json.loads(swaymsg.stdout)
current = data["nodes"][1]["current_workspace"]