[i3-discuss] Re: is there a way to select a window for repositioning

  • From: frederik@xxxxxxx
  • To: Orestis Flo <orestisf1993@xxxxxxxxx>
  • Date: Wed, 30 Jan 2019 11:35:14 -0800

Did something change recently to break this? I did an upgrade of Arch
Linux and this no longer works. Here is the fragment in my .i3/config:

   # "kill" and "yank"
   bindsym $mod+w mark _copy
   bindsym $mod+y mark _paste, [con_mark=_copy] move to mark _paste, 
[con_mark=_copy] focus

Now, if I remove the "_"'s then I can see that the marks are being
created, but the window movement and focus is not done.

Thank you!

Frederick

On Sat, Oct 13, 2018 at 12:13:35PM -0700, frederik@xxxxxxx wrote:

Thank you Orestis for doing that research.

I have $mod+c bound to "kill", but it turns out that Emacs-style
bindings "w" and "y" were available to me. I also feel like it's
better to focus the window I just "pasted", so I have this in my
config:

bindsym $mod+w mark _copy
bindsym $mod+y mark _paste, [con_mark=_copy] move to mark _paste, 
[con_mark=_copy] focus

I now have a perhaps-related question, when I open a PDF in Evince, if
it is already open, what happens is that the focus changes to the
window where it is open, perhaps far away from the current one. But I
would rather have this window just move to where it would usually
appear, had it not already been open - i.e. somewhere after the
currently focused window. In other words, it's great if the document
is already open, because it can appear faster; but I'd rather have the
window appear in the same place as when it had not been open, so I
don't have to get confused by having to remember which documents are
open, or by being teleported to strange places in the workspace, etc.
Do you (or someone else here) have a trick for getting this to be
consistent? It seems that it should be possible using the mark
facility you just described (but maybe there is a simpler way as
well).

By the way, if the PDF is already open in a separate workspace, then
what happens is even more confusing - I don't see it at all, but I
have to navigate to various workspaces looking for a title which is
highlighted in red. There is a similar problem with Firefox, unless I
open a URL with "--new-window"...

Thanks,

Frederick

On Sat, Oct 13, 2018 at 03:02:00PM +0300, Orestis Flo wrote:
vim-like marks have been around for a long time:
https://github.com/i3/i3/commit/3ada8f326cc48ea0f12c9f1434fbb2b76ed4c0a0
'move to mark' is a bit more recent:
https://github.com/i3/i3/commit/94bbdc9159f43181f9d9069893e812c1226eda00
which was released in 4.11 - 2015

On Sat, Oct 13, 2018 at 1:52 PM <frederik@xxxxxxx> wrote:

> That's great, thank you!
>
> Any idea how long this feature has been around?
>
> On Sat, Oct 13, 2018 at 12:38:15PM +0300, Orestis Flo wrote:
> > You can use vim-like marks:
> > https://i3wm.org/docs/userguide.html#vim_like_marks
> >
> > bindsym $mod+c mark _copy
> > bindsym $mod+p mark _paste, [con_mark=_copy] move to mark _paste
> >
> > On Sat, Oct 13, 2018 at 9:02 AM <frederik@xxxxxxx> wrote:
> >
> > > Dear i3 people,
> > >
> > > I normally move windows with commands like
> > >
> > >     bindsym $mod+Ctrl+b move left
> > >
> > > or
> > >
> > >     bindsym $mod+Ctrl+1 move container to workspace 1
> > >
> > > Sometimes this is cumbersome, because for example with the first
> > > command I am staring at the same window the whole time I am trying to
> > > move it left or right among the tabs. (It's a bit hard to explain; try
> > > moving a window to see what I mean.) I have to figure out where I'm
> > > moving the window by looking at the titles of neighboring windows,
> > > which are sometimes not unique. For the second command it's pretty
> > > much the same problem, I'm looking at the window I want to move and I
> > > have to keep in my head which sort of windows are in Workspace 1, or
> > > whatever workspace I want the focused window to have its new home.
> > >
> > > It would be easier for me if I could have some command to select a
> > > window, like "copy" or "kill" (Emacs terminology), so that the window
> > > is in a "clipboard" or "kill ring", and another command which is like
> > > "paste" or "yank" which would move the copied window just after (or
> > > before) the one which is currently focused.
> > >
> > > I think that in many cases this would provide a more natural user
> > > interface, since I would be able to see the future neighbors of the
> > > window I am trying to move, rather than just seeing their titles or
> > > knowing their workspace numbers. Often I already have a familiarity
> > > with the window I am trying to reposition, but I need to remind myself
> > > what sort of other windows are in a particular workspace, or in a
> > > particular area of the current workspace. Being able to see these
> > > other windows before initiating the "move" operation would be helpful.
> > >
> > > In other words, I want to have an interaction like this:
> > >
> > >     * realize that I want window A next to window B
> > >     * navigate to window A
> > >     * "select/copy" window A
> > >     * navigate to window B
> > >     * "paste" window A next to window B
> > >
> > > Has anyone suggested or implemented this idea?
> > >
> > > Thanks,
> > >
> > > Frederick
> > >
> > >
>


Other related posts: