iter
This commit is contained in:
parent
769db9df6e
commit
8482d5dff3
8 changed files with 74 additions and 38 deletions
17
util/toggle_mon.xsh
Normal file
17
util/toggle_mon.xsh
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue