News for hackers. Stuff that matters.
Re:i3 4.18 by Barrin92 on Monday February 17, 2020 @02:02PM (#22349728)
been a long time i3 user mostly for the sane defaults. It requires significantly less fiddling than any other window manager I've tried out.
Re:i3 4.18 by abjKT26nO8 on Monday February 17, 2020 @02:07PM (#22349767)
Have you figured out how to make i3 move the mouse pointer to the area of the newly-focused window when you change window focus by keyboard? AwesomeWM does that out of the box. i3 doesn't and it's very annoying, because then when my table makes a microscopic movement and causes the mouse to move, suddenly what I'm typing is diverted to another window and weird things happen.
Re:i3 4.18 by qu4z-2 on Monday February 17, 2020 @05:58PM (#22351747)
I opened an issue about it in the past at https://github.com/i3/i3/issues/2971 . Apparently it's not on the roadmap, but someone posted an xdotool script in the comments that you can chain with every focus switching command in your i3config thusly:

  bindsym $mod+h focus left; exec --no-startup-id center-mouse
I've been using that and it fixes the issue for me, even though it seems silly that it's not built-in given there's a mouse_warping config setting.

That said, I thought i3's default behaviour was that it would only focus a window when the mouse entered it, not when the mouse was moving around within a window, so I'm surprised you're having that issue. For me I just got sick of my mouse being "way over there" in the odd situation I need it.

Re:i3 4.18 by paulddraper on Monday February 17, 2020 @03:01PM (#22350226)
i3 does this, but only if the window is on a different screen.

https://i3wm.org/docs/userguide.html#_mouse_warping

> By default, when switching focus to a window on a different output (e.g. focusing a window on workspace 3 on output VGA-1, coming from workspace 2 on LVDS-1), the mouse cursor is warped to the center of that window.

> With the mouse_warping option, you can control when the mouse cursor should be warped. none disables warping entirely, whereas output is the default behavior described above.

I agree that would be nice, though I've never really minded; If I'm gonna touch the mouse, I'm gonna touch the mouse.

Re:i3 4.18 by abjKT26nO8 on Monday February 17, 2020 @05:21PM (#22351441)
> I agree that would be nice, though I've never really minded; If I'm gonna touch the mouse, I'm gonna touch the mouse.

My problem is that my table isn't perfectly stable, so when I type, my mouse moves on its own by microscopic distances. When I'm in the middle of typing, the results range from mildly annoying to infuriating, depending on how a random application handles given input.

I've just found this video describing a solution (writing a minimal script): <https://www.youtube.com/watch?v=7QeZkq88jTw>

Re:i3 4.18 by jolmg on Monday February 17, 2020 @02:12PM (#22349823)
You can fix that with:

  focus_follows_mouse no
It doesn't do what you wanted, but I also can't see why anyone would want a window to focus simply because you hovered over it.
Re:i3 4.18 by tmm on Monday February 17, 2020 @02:22PM (#22349904)
Because why should I have to click to get focus?

Less of an issue on a tiling window manager, but sometimes I really want to be able to type in a window without bringing it to the foreground.

Also, selecting text should copy and middle click should paste. No one can convince me these things are bad or unnecessary.

Re:i3 4.18 by jolmg on Monday February 17, 2020 @02:28PM (#22349956)
> Because why should I have to click to get focus?

The click not only focuses but is also passed on to whatever you clicked on, so it's like it was already focused.

> Less of an issue on a tiling window manager, but sometimes I really want to be able to type in a window without bringing it to the foreground.

I don't understand that. You have to somehow indicate to the system what it is you want to type on.

> Also, selecting text should copy and middle click should paste. No one can convince me these things are bad or unnecessary.

I'm 100% with you on that. Although saying "selecting text should copy" makes it sound like it's being copied when selecting, when it's actually copied when pasting.

Re:i3 4.18 by ubercow13 on Monday February 17, 2020 @03:42PM (#22350540)
>You have to somehow indicate to the system what it is you want to type on

You do it by moving the mouse. It makes the mouse more useful because you can now focus things with one less click.

On the other hand, in what circumstance would you want to move your hand to the mouse, move it intentionally over another window without clicking, and _not_ focus it? What would be the point in moving the cursor?

Re:i3 4.18 by jolmg on Monday February 17, 2020 @05:42PM (#22351612)
> in what circumstance

Precisely in the one that brought this into topic. It's nice to not have to be so careful with how the mouse moves. When it gets in the way, I can just flick it off, not worried about my stuff changing focus. It also greatly decreases the annoyance of accidentally touching a touchpad while typing.

Re:i3 4.18 by ubercow13 on Monday February 17, 2020 @06:39PM (#22352033)
Fair enough, that makes sense. In practice I don't ever find I make mistakes with the mouse and focusing, but then I am very good with the mouse (after playing those FPS games :)
Re:i3 4.18 by zimmertr on Monday February 17, 2020 @02:16PM (#22349858)
I love that feature though!
Re:i3 4.18 by megous on Monday February 17, 2020 @02:13PM (#22349829)
i3wm does this for me. I don't see anything special in my config that would be enabling that. When I move to a window via keyboard, mouse will center on that window.
Re:i3 4.18 by mjlee on Tuesday February 18, 2020 @05:06AM (#22354798)
Are you running a multi monitor setup?

I've just tested it and it does centre on the window only if the window is on a different monitor.

Re:i3 4.18 by megous on Tuesday February 18, 2020 @09:37AM (#22356345)
Myabe that's it. Yes I do. Yeah, it only happens when changing focus to a window on a different monitor via keyboard.
Re:i3 4.18 by abjKT26nO8 on Monday February 17, 2020 @02:57PM (#22350192)
Could you share you config somehow?
Re:i3 4.18 by jolmg on Monday February 17, 2020 @02:06PM (#22349758)
With exception of the directional keybindings. I wonder how it came to be that the defaults are "jkl;" for the directions instead of the "hjkl" used by everything else (vi(m), less, shells, repls, etc.).
Re:i3 4.18 by yyhhsj0521 on Monday February 17, 2020 @02:12PM (#22349820)
It seems that the intention was to emulate Vim [0], maybe the author was not familiar with it and made a mistake?

[0] https://github.com/i3/i3/commit/6d0071db197031845b5f77febc22...

Re:i3 4.18 by ppseafield on Monday February 17, 2020 @03:10PM (#22350303)
IIRC it was deliberate so that users wouldn't have to move off the home row. The User's Guide states this is the reasoning behind it.

> To move the focus between the two terminals, you can use the direction keys which you may know from the editor vi. However, in i3, your homerow is used for these keys (in vi, the keys are shifted to the left by one for compatibility with most keyboard layouts). Therefore, $mod+j is left, $mod+k is down, $mod+l is up and $mod+; is right.

https://i3wm.org/docs/userguide.html

Re:i3 4.18 by jolmg on Monday February 17, 2020 @04:27PM (#22350960)
> in vi, the keys are shifted to the left by one for compatibility with most keyboard layouts

I wonder where they got that idea. The keys are "hjkl" simply because they were inscribed with arrows in the machine Bill Joy used when creating vi[1][2]. From [1]:

> Joy used a Lear Siegler ADM-3A terminal... the keys h,j,k,l served double duty as cursor movement keys and were inscribed with arrows, which is why vi uses them in that way.

The StackExchange question has a picture of the keys.

[1] https://en.wikipedia.org/wiki/Vi#Creation

[2] https://vi.stackexchange.com/a/9315/14283

Re:i3 4.18 by secure on Monday February 17, 2020 @04:34PM (#22351045)
I remember reading about that, but it must have been after I wrote that part of the userguide 11 years ago: https://github.com/i3/i3/commit/1fcad44f66926e679f4af6e4f4d6... :)

Can you send a PR for https://github.com/i3/i3/blob/30e886b0319ee948863a36a65e5b72... with your correction please?

Re:i3 4.18 by jolmg on Monday February 17, 2020 @04:44PM (#22351110)
I'm not sure what you want the correction to be. Just delete the note in parentheses? Or change the default to "hjkl"?
Re:i3 4.18 by secure on Monday February 17, 2020 @04:54PM (#22351191)
Ideally, replace the note in parentheses with the correct historical reason that you explained in your comment here? :)
Re:i3 4.18 by jolmg on Monday February 17, 2020 @05:27PM (#22351497)
Isn't the note there to explain why i3 differs from vi? Adding the historical reason why vi used hjkl doesn't seem to justify i3 differing. It's almost irrelevant.

Or do you think that not having arrows on "hjkl" is the justification of using "jkl;"?

Personally, I can't see a good reason for "jkl;". The rationale that those are the keys where the fingers rest has been brought up here, but here is my response:

https://news.ycombinator.com/item?id=22349868

The thing is that I believe the designers of ADM-3A made a good choice in putting the arrows on "hjkl" as opposed to "jkl;". It's much more ergonomic.

Re:i3 4.18 by jolmg on Tuesday February 18, 2020 @03:03PM (#22359768)
s/the justification of/a rationale to/ and s/justify/rationalize/.

Couldn't think of the right word at the time.

Re:i3 4.18 by awake on Monday February 17, 2020 @02:09PM (#22349782)
h for help and your fingers rest on jkl; not hjkl if you are typing with proper form
Re:i3 4.18 by jolmg on Monday February 17, 2020 @02:17PM (#22349868)
When you're browsing text, though, it's more common to move up and down in text than it is to move sideways.

If you're typing with proper form, "hjkl" results in the index finger moving down and the middle finger moving up. So, your most useful finger is used for the most common action, and your second most useful finger for the second most common action. What's probably the third most common action, moving left would be done with your index finger, and right with your ring finger. You'd never have to use your awkward pinky finger for anything.

With "jkl;", you'd be moving down with the middle finger, and up with the ring finger. Your dexterious index finger would be waiting for the moment when you'd want to move left, which is not as often, and you'd be encouraged to use your awkward pinky finger quite often.

This isn't necessarily the case when working with windows, but by now it's a matter of consistency. Although, encouraging to use the pinky finger and not being able to use the index finger for 2 actions still sucks.

Re:i3 4.18 by msoucy on Monday February 17, 2020 @02:09PM (#22349785)
Probably just QWERTY "home row" layout
Re:i3 4.18 by calvinmorrison on Monday February 17, 2020 @02:13PM (#22349830)
i am always surprised when people do not have

noremap ; l

noremap l k

noremap k j

noremap j h