dotfiles/config/i3/cycle-monitor.py

17 lines
594 B
Python
Raw Normal View History

2018-11-26 09:38:46 +00:00
#!/usr/bin/env python
# Source: https://gist.github.com/justbuchanan/00b8d4aac604fa6ab41b7c5acae71ee8
import i3
outputs = i3.get_outputs()
workspaces = i3.get_workspaces()
# figure out what is on, and what is currently on your screen.
workspace = list(filter(lambda s: s['focused']==True, workspaces))
output = list(filter(lambda s: s['active']==True, outputs))
# figure out the other workspace name
other_workspace = list(filter(lambda s: s['name']!=workspace[0]['output'], output))
# send current to the no-active one
i3.command('move', 'workspace to output '+other_workspace[0]['name'])