PaperWM
PaperWM copied to clipboard
Option to center a window in focus.
New option in settings. If the Windows are centered immediately, it will make it much easier to navigate with the mouse on two monitors.
Now it is very difficult to aim the mouse at the very edge of the screen to switch to the next window without accidentally clicking on the second monitor.
isn't the point to use the keyboard rather than the mouse?
super+arrow left/right to focus another window and super+c to center
I was looking to do this not because of easier mouse navigation but because I find that having the focused window in the centre is better for ergonomics. @gavr123456789 It's easy to tweak the extension code to add this. Just add this line to the end of the focus_handler
function in tiling.js
(around line 2745):
centerWindowHorizontally(metaWindow);
I've made a test branch for this: sticky-center
, which will continue to center windows if the current window is centered.
Is there a way to achieve this without having to fork PaperWM?
Is this still of value to others? I can see the value in it. Let me know and I can create a PR for this - maybe with a toggle to enable/disable this functionality.
I think this sounds like a nice feature. I can see myself liking this behavior.
Hey all, please have a look at #482 which implements this - need some feedback there!
Now it is very difficult to aim the mouse at the very edge of the screen to switch to the next window without accidentally clicking on the second monitor.
This seems like it could be solved by increasing the "horizontal margin" setting.
isn't the point to use the keyboard rather than the mouse?
Mouse support makes for a smooth onboarding experience for people more used to navigating that way. Also, when my hand is already on the mouse (e.g. for clicking something in the browser) it's sometimes more convenient to use the mouse to switch windows than switching back to the keyboard. In short, mouse support is good as long as it doesn't make keyboard support worse.
Is this still of value to others? I can see the value in it.
I also see the value, particularly for the ergonomics, as @johnfraney mentioned. Normally this is pretty easy to do with the keyboard (Meta-C after changing active windows), but not so easy with the mouse.
There is still a question of how it should be implemented.
- Toggle in the settings?
- Runtime toggle via hotkey?
- Global, per-monitor, per-workspace, or per-window?
- Meta-Ctrl-C and Meta-Shift-C are open
@jtaala already create a PR (#482) and I made a comment there too, but to give an opinion on how it could be implemented, I think:
- Add a toggle in the settings to enable this "centering mode" by default (but keep it off by default)
- Add a keybinding to toggle it (maybe Super-Shift-C, because Ctrl already means "move" in my mind)
- I think it should be scoped to the workspace or global because that is probably the easiest to implement (per-window doesn't make much sense IMO, but per-monitor would probably also be ok)
- Also add an indicator if the mode is active to the WorkspaceMenu (the thing that says "Workspace X") in the topbar
In PR #482 it is currently scoped to per-workspace (kind of, actually the mode is active as long as the current window is centered). And it uses the keybinding Super+C.
Thanks all,
Appreciate the comments and feedback! Maybe to start we can implement a a user option for whether it's enabled by default (I won't create a toggle in settings yet but you'll able to change it via dconf), and implement a new key-binding (will usemeta+shfit+c
for default) to toggle the mode. I'll make it workspace scoped (that makes sense to me since some on one workspace might want to have side-by-side view; but on another might want centered view).
We can test it out after that and see what we think for going forward.
Jay.
All, #482 is ready for review. I've implemented a "focus mode" (with topbar icon showing current mode - also the icon it clickable to toggle focus mode). Also implemented (default) super
+Shift
+c
shortcut to toggle modes.