diff options
author | neodarz <neodarz@neodarz.net> | 2019-09-05 07:48:16 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-09-05 07:48:16 +0200 |
commit | 9b19480228d8421c3987a634a602012c953a993e (patch) | |
tree | 4bce21766502f3a72bb2002daeea2a406c2a3bda /dotfiles/scripts/cycle-workspace.py | |
parent | 40dddc15f4a323d3c84c84be7bb2c5ca94d3c07c (diff) | |
download | dotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.tar.xz dotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.zip |
Add some scripts
Diffstat (limited to '')
-rwxr-xr-x | dotfiles/scripts/cycle-workspace.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/dotfiles/scripts/cycle-workspace.py b/dotfiles/scripts/cycle-workspace.py new file mode 100755 index 0000000..7f176db --- /dev/null +++ b/dotfiles/scripts/cycle-workspace.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +#https://gist.github.com/97-109-107/b70356670ae8309ffb4f + +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']) + + + +#print(str(list(filter(lambda s: s['active']==True, workspaces)))) + +i3.command('workspace', other_workspace[0]['current_workspace']) +i3.command('move', 'workspace to output '+workspace[0]['output']) |