记录一下如何在Windows和Ubuntu系统中实现窗口平铺。
Windows
在Windows中,使用微软开发的PowerToys工具箱中的FancyZones工具可以满足大部分需求:
- 长按
Shift并拖动窗口将当前窗口平铺到指定区域; Win+方向键将当前窗口平铺到指定区域;Win+Shift+~自定义平铺区域样式;
Ubuntu
在Ubuntu中,实现窗口平铺的方案较多,但是大部分的配置过程较为复杂。
gTile
gTile可以作为GNOME扩展直接安装,使用体验较好。
安装
-
安装本地支持组件
chrome-gnome-shell:sudo apt install chrome-gnome-shell gnome-shell --version - 安装浏览器扩展
GNOME Shell integration; - 在GNOME Shell Extensions网站上安装和管理gTile扩展;
使用
| 功能 | 快捷键 |
|---|---|
| 打开界面 | Super+Enter |
| 将当前窗口缩放到左下角 | Super+Alt+1 |
| 将当前窗口缩放到正下方 | Super+Alt+2 |
| 将当前窗口缩放到右下角 | Super+Alt+3 |
| 将当前窗口缩放到左侧 | Super+Alt+4 |
| 将当前窗口缩放到中央 | Super+Alt+5 |
| 将当前窗口缩放到右侧 | Super+Alt+6 |
| 将当前窗口缩放到左上角 | Super+Alt+7 |
| 将当前窗口缩放到正上方 | Super+Alt+8 |
| 将当前窗口缩放到右上角 | Super+Alt+9 |
- 缩放位置与数字小键盘上的键位对应;
- 重复按缩放快捷键可以改变缩放大小;
x-tile
x-tile可以作为软件包直接安装并配置,较为简便,但是仍无法达到类似Windows的使用体验。
安装
sudo add-apt-repository ppa:giuspen/ppa
sudo apt update
sudo apt install x-tile
配置
- 取消勾选
Exit After Tile; -
Edit->Preferences设置首选项:Language选择语言;- 对于主显示器,预留出任务栏的宽度以保证最佳的窗口平铺效果:
- 勾选
Override Monitor 1 Tiling Area; Position设置平铺区域位置(左上角坐标);Size设置平铺区域大小(宽度和高度);- 在1920*1080的分辨率下,任务栏宽度约为65像素;
- 勾选
使用
-
语法说明:
x-tile [option] -
选项含义:
option 含义 缺省 打开主界面 wopen the x-tile main window without using the panel zundo the latest tiling operation ftile all opened windows vertically htile all opened windows horizontally utile all opened windows triangle-up dtile all opened windows triangle-down ltile all opened windows triangle-left rtile all opened windows triangle-right qquad tile all opened windows g = g 0 = g 0 0tile all opened windows in a grid with automatic rows and columns g rows = g rows 0tile all opened windows in a grid with given rows and automatic columns g 0 colstile all opened windows in a grid with automatic rows and given columns g rows colstile all opened windows in a grid with given rows and columns 1custom tile 1 all opened windows 2custom tile 2 all opened windows iinvert the order of the latest tiling operation ycycle the order of the latest tiling operation mmaximize all opened windows Munmaximize all opened windows cclose all opened windows
参考
- Tiling window manager-Wikipedia
- microsoft/PowerToys
- 13 Best Tiling Window Managers for Linux-Tecmint
- 20 Best tiling window managers for Linux as of 2023-Slant
- Linux app for snapping windows into “Zones”
- gTile-GNOME Shell Extensions
- gTile/gTile
- 如何安装GNOME插件-techmoe的文章-知乎
- x tile-giuspen
- giuspen/x-tile
- baskerville/bspwm