This commit is contained in:
alisceon 2026-03-06 15:09:04 +01:00
parent 769db9df6e
commit 8482d5dff3
8 changed files with 74 additions and 38 deletions

17
util/toggle_mon.xsh Normal file
View file

@ -0,0 +1,17 @@
import json
status = json.loads($(swaymsg -t get_outputs --raw))
monitors = [mon["name"] for mon in status]
focused = [mon["name"] for mon in status if mon.get("focused", False)][0]
disabled = [mon["name"] for mon in status if not mon["active"]]
if disabled:
for mon in disabled:
print("enabling " + mon)
swaymsg output @(mon) enable
else:
for mon in monitors:
if mon != focused:
print("disabling " + mon)
swaymsg output @(mon) disable