Invisible workspaces or scratchpad for entire workspaces
I have a number of workspaces that I would like to be disappear when they are no longer the active workspace on a screen. In effect they would disappear just like empty workspaces disappear when you navigate away, though their contents would remain if you revisited them with their dedicated workspace switcher (bindsym $mod+1 workspace 1
). They would not however be accessible by cycling with next_on_output
. Ideally these clients would also be invisible on the the i3-status bar, though this is a optional consideration.
Another way of framing this is that I want a scratchpad for entire workspaces.
I think that this could be achieved with liberal use of i3-py (though I'm not sure it even includes every call I'd need). In any case it is horrifyingly kludgy.
on keypress exec
if focus not on workspace
go to workspace
# i have a multi-head setup so focus might just have been on the other output
if workspace is empty
get client matching instance from scratchpad
toggle float mode of client
else
verify that all clients in workspace have defined instance
store all clients with said instance in scratchpad
# does i3-py let you figure this out?
# back_and_forth is the previously focused workspace
if back_and_forth is on current output
# causes the empty workspace now disappears
workspace back_and_forth
# i don't want to leave the now empty workspace open on that output
else
prev_workspace = back_and_forth
# causes the empty workspace now disappears
navigate to next_on_output
# jumps focus back to previous output
navigate to prev_workspace
# this seems like a particularly terrible idea!
with all requests to change workspaces exec
temporary_workspaces = ["foo", "bar", "baz"]
if workspace in temporary_workspaces is not active workspace on an output
verify that all clients in that workspace have defined instance
store all clients with said instance in scratchpad
Please, please, please tell me there is a better way to do that!
This suggestion is untried and probably bogus. Maybe you could hide workspaces by moving them to an unused RandR monitor output such as VGA? In the userguide see: http://i3wm.org/docs/userguide.html#_moving_containers_workspaces_to_randr_outputs
@KJ44 Just tried it. Unfortunately it doesn't work if the output is disconnected, but definitely a clever idea. I'll see if I can trick my computer into thinking that VGA-1 is connected. In any case, I like how you think!
Hardware hack! http://www.mp3car.com/general-hardware-discussion/1763-how-does-a-video-card-detect-vga-monitor-is-present.html.