I want to switch to the lowest workspace that doesn't have any windows on it
quite often. Because I use multiple monitors it is not always obvious and quick
to see which workspaces are currently in use. So i wrote a little script that
switches (or moves a window) to the lowest empty workspace.
#!/bin/bash
for i in {1..100}
do
res=$(i3-save-tree --workspace $i | grep -v "^//")
if [ -z "$res" ]; then
if [ $1 = "m" ]; then
i3-msg move workspace $i
fi
if [ $1 = "n" ]; then
i3-msg workspace $i
fi
break
fi
done
It works pretty well but is kinda hackish and could be faster. I am not aware
of any native support for this use case. Does anyone know about a better way of
addressing this use case?
Thanks.
Heimo