Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[move] Add choice of anchor as well as more predefined positions #3689

Open
suuuehgi opened this issue Apr 21, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@suuuehgi
Copy link

commented Apr 21, 2019

I'm submitting a…

[ ] Bug
[x] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

(Floating windows)

  • move command is relative to the upper left corner.
  • move position center is the only fixed / predefined position (and relative to the upper left corner).

Desired Behavior

(Floating windows)

  • Choose anchor point (point of reference)
    E.g.: move <left|right|down|up> [<px> px] [anchor <tl|tr|bl|br|c>]
  • Multiple possible positions (that imply different anchor points)
    E.g.: move position <bottom|center|top> <left|center|right>

Environment

Output of i3 --moreversion 2>&-:

i3 version: 4.16.1
- Linux Distribution & Version: Debian testing (buster), 4.19.0-4-amd64
- Are you using a compositor (e.g., xcompmgr or compton): No

Thanks a lot!

@i3bot i3bot added the enhancement label Apr 21, 2019

@Airblader

This comment has been minimized.

Copy link
Member

commented Apr 21, 2019

The "Current Behavior" description sounds like you are talking exclusively about moving floating windows. Is this correct?

E.g.: move <left|right|down|up> [ px] [anchor <tl|tr|bl|br|c>]

Could you explain what all of these would do?

E.g.: move position <bottom|center|top> <left|center|right>

All of these can be trivially achieved using external scripts. The "move center" one is the odd one out because i3 itself does actually need this (floating, scratchpad).

@suuuehgi

This comment has been minimized.

Copy link
Author

commented Apr 21, 2019

The "Current Behavior" description sounds like you are talking exclusively about moving floating windows. Is this correct?

Yes, sorry I forgot that.

Could you explain what all of these would do?

E.g.: move position <bottom|center|top> <left|center|right>

Move a floating window to a position from {bottom, center, top} X {left, center, right}.

E.g. move position center right: The center of the right side of my floating window attached / aligned with the center of the right side of my screen.

draft

It would be very handy for me not to rely on extra scripts and extra programs doing the calculations since this is window size and screen resolution dependent.

@Airblader

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

It would be very handy for me not to rely on extra scripts and extra programs doing the calculations since this is window size and screen resolution dependent.

But scripts can easily account for that?

@suuuehgi

This comment has been minimized.

Copy link
Author

commented Apr 26, 2019

But scripts can easily account for that?

That depends on the definition of easy or rather the viewpoint. Someone working on the code base could maybe do this "easily".

Afaik would I have to write a separate script for every application and after 10 min of googling I still don't know how to get the window dimensions for the calculations although I once wrote something similar (I can not find anymore).*
So, from my pov, maybe simple but definitely not easy and definitely not comfortable.


*I remember slightly that I had to install a separate X package, what would kill the portability of the config.

@Airblader

This comment has been minimized.

Copy link
Member

commented Apr 26, 2019

Afaik would I have to write a separate script for every application

I wouldn't see why the application matters. The script just has to figure out the current window, its dimensions, the screen dimensions, do whatever math you want to do and reposition the window. All of this can be done using i3's IPC, using a lot of open tools such as xdotool, or by speaking to X directly (using Xlib or xcb).

I'm not too inclined to add more commands to i3 here because we are not a floating window manager and try to limit floating window support to the necessary things. We already allow move position to exact pixel-based positioning, which is a compromise as it keeps API surface small but allows for maximum flexibility.

If you need help writing such a script, you can head over to /r/i3wm where people might well be able to help you out. Chances are someone already wrote something like this, even.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.