简体   繁体   English

awesome-wm:将浮动客户端移动到屏幕中心

[英]awesome-wm: move floating client to the center of screen

In Awesome WM is there a way to bind a key combination to move the focused floating client to the center of the screen? 在Awesome WM中是否有一种绑定组合键以将聚焦浮动客户端移动到屏幕中心的方法? (the client should be neither maximized nor fullscreen) (客户端既不应最大化也不应全屏)

I was checking the documentation but apparently there is not such a function. 我正在检查文档,但显然没有这样的功能。

So as an alternative I was thinking to get the current screen width and height and then set the x and y properties of the client accordingly (taking into account also the width and height of the client itself). 因此,作为替代方案,我想要获取当前屏幕宽度和高度,然后相应地设置客户端的x和y属性(同时考虑客户端本身的宽度和高度)。

I'd like to know if there is an easier way to perform the same action. 我想知道是否有更简单的方法来执行相同的操作。

An easier way is awful.placement if you are using 4.0 version. 如果您使用的是4.0版本,那么更简单的方法就是awful.placement Otherwise manually set client geometry seems like most reliable way to make such alignment. 否则,手动设置客户端几何图形似乎是进行此类对齐的最可靠方法。

To complement Worron answer, you need to use the placement API 要补充Worron的答案,您需要使用展示位置API

https://awesomewm.org/apidoc/libraries/awful.placement.html https://awesomewm.org/apidoc/libraries/awful.placement.html

Add a keybinding in the clientkeys table. clientkeys表中添加键绑定。 It will look like: 它看起来像:

awful.key({ modkey, "Shift"   }, "y", awful.placement.centered),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM