How to check which workspace is currently focused from skript
Is it possible to check which workspace is currently focused and using this information in a bash script? I did some google research but didn't come up with anything useful ..
Is it possible to check which workspace is currently focused and using this information in a bash script? I did some google research but didn't come up with anything useful ..
Depends on what tool you can use for parsing json. With python you can do this oneliner:
$ focused_ws=$(i3-msg -t get_workspaces | python -c 'import json,sys;ws=json.load(sys.stdin);print(list(filter(lambda x: x["focused"], ws))[0]["name"])')
$ echo $focused_ws
1: main
Asked: 2015-10-25 19:20:49 +0000
Seen: 55 times
Last updated: Oct 25
You may wanna read this: http://i3wm.org/docs/ipc.html