You are not logged in.

#1 2017-03-19 16:56:54

kox
Member
Registered: 2015-05-01
Posts: 149

i3 - alternate between windows in a workspace

I was wondering would it be possible for a i3 configuration like that. I use super key + numbers to switch between workspaces. I often have multiple windows in a workspace, for example 2 browser profiles in  workspace no. 1, 2 code editor instances in workspace no.2. It would be very nice to be able to alternate between windows in a workspace also using super key + number of the workspace. So it would be possible to navigate between all windows intuitively with only super key and numbers.

The logic would have to be like this:

Super + (0 - 9)

   If workspace is already open: switch to the next window in the workspace
   else switch to the workspace

For example I'm in workplace 1, I want to go to the editor workspace, I use super + 2. Then I want to switch to another editor instance, I also use super + 2.

Would it be possible to implement this in i3?

Offline

#2 2017-03-19 17:04:45

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: i3 - alternate between windows in a workspace

What you are asking is against the logic of having having multiple different workspaces. Simple solutions is to use only one workspace, or keep all the windows in which you want to move in single workspace while rarely used windows in other workspaces.

Offline

#3 2017-03-19 17:12:01

kox
Member
Registered: 2015-05-01
Posts: 149

Re: i3 - alternate between windows in a workspace

There are only 10 workspaces available if each is assigned to digit, which is the easiest to remember. If I have multiple editor instances, or multiple terminal instances, having them each open in separate workspace is impractical and impossible to remember. That's why I group applications by workspace. Anyway for now I decided that I use the "grave" ~ key to alternate between windows, as it is close to the digits and it will be a matter of muscle memory to remember and use it smoothly, but still would like to know if it would be possible to do it with digits.

Offline

#4 2017-03-19 17:20:30

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: i3 - alternate between windows in a workspace

You may try using "workspace next", "workspace prev", to move next or previour workspaces (it will not go to empty workspace)
I am using super+Next and super+Prior (that is super with pageup/down keys) for next and previous workspaces while, super+Left/Right/Up/Down are used for moving between windows (focus left/right/up/down). This keys are close to each other and works nice for me.

Offline

#5 2017-03-19 19:46:48

stupidus
Member
Registered: 2012-02-27
Posts: 124

Re: i3 - alternate between windows in a workspace

What you want to do could be realized by a simple bash/python/perl/"insert favorite scripting language" script. Just bind mod+num to yourscript num. The script can then check the i3-ipc for the current workspace, if it is the same as $1, then execute the window switch command, else call the workspace change command.

Or you could get more then ten workspaces by using the F1 to F12 keys, to get workspace 11 to 22.

Offline

Board footer

Powered by FluxBB