Skip to content

Commit 8595fd9

Browse files
authored
version 15.1: smart window border, new keybindings, bugfixes and more! (#217)
1 parent 77cc572 commit 8595fd9

36 files changed

+2288
-403
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,13 @@ You can select your favorite layout for each workspace of each monitor.
127127

128128
When a window is created, it is automatically moved to the best tile according to where other windows are tiled and the current layout. This is disabled by default and can be enabled in the preferences.
129129

130-
131130
[automatic_tiling](https://github.com/user-attachments/assets/76abc53f-2c6d-47ab-bee3-bbcdd946f2a1)
132131

132+
### Export and import layouts ###
133+
134+
*Tiling Shell* supports importing and exporting its layouts to a JSON file. With this you can create your own custom layouts without the built-in graphical editor, or share your layouts with others! If you are interested into knowing more about the contents of the layout file check the official [documentation](./doc/json-internal-documentation.md).
135+
136+
133137
<p align="right"><b>Go to Usage</b> <a href="#usage">⬆️</a></p>
134138

135139
## Installation

doc/example-layouts.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[
2+
{
3+
"id": "split-half",
4+
"tiles": [
5+
{
6+
"x": 0,
7+
"y": 0,
8+
"width": 0.5,
9+
"height": 1,
10+
"groups": [
11+
2
12+
]
13+
},
14+
{
15+
"x": 0.5,
16+
"y": 0,
17+
"width": 0.5,
18+
"height": 1,
19+
"groups": [
20+
1
21+
]
22+
}
23+
]
24+
},
25+
{
26+
"id": "split-thirds",
27+
"tiles": [
28+
{
29+
"x": 0,
30+
"y": 0,
31+
"width": 0.333,
32+
"height": 1,
33+
"groups": [
34+
2,
35+
3
36+
]
37+
},
38+
{
39+
"x": 0.333,
40+
"y": 0,
41+
"width": 0.333,
42+
"height": 1,
43+
"groups": [
44+
3,
45+
1
46+
]
47+
},
48+
{
49+
"x": 0.666,
50+
"y": 0,
51+
"width": 0.333,
52+
"height": 1,
53+
"groups": [
54+
2,
55+
1
56+
]
57+
}
58+
]
59+
}
60+
]

doc/json-internal-documentation.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Documentation for JSON exported layouts
2+
3+
*Tiling Shell* supports importing and exporting its layouts as a JSON file. With this you can create your own custom layouts, or fine-tune already existing layouts.
4+
5+
The exported layouts (from the preferences) are a collection of `Layout` objects. A `Layout` object is an object with two (2) properties:
6+
7+
- identifier as a `string`
8+
- a list of `Tile` objects
9+
10+
Example JSON of a `Layout` object would look like
11+
12+
```json
13+
{
14+
"id": "The identifier",
15+
"tiles": [
16+
...
17+
]
18+
}
19+
```
20+
21+
A `Tile` object has five (5) properties:
22+
23+
- The X (`x`) axis as a `float`
24+
- The Y (`y`) axis as a `float`
25+
- The width (`width`) as a `float`
26+
- The height (`height`) as a `float`
27+
- A list of identifiers `groups`
28+
29+
The `x`, `y`, `width` and `height` are percentages relative to the screen size. Both `x` and `y` start from the top left of a `Tile`.
30+
31+
So a `Tile` with `x` = 0.5 and `y` = 0.5, on a screen with a resolution of 1920x1080 pixels is placed at `x = 0.5 * 1920 = 960px` and `y = 0.5 * 1080 = 540px`. For example, if the `width` and `height` of the `Tile` are set to `0.25`, this gives a `Tile` of `width = 0.25 * 1920 = 480px` and `height = 0.25 * 1080 = 270px`.
32+
33+
The `group` attribute is mainly used in the layout editor where it determines which `Tile`(s) are "linked": if you resize a single `Tile` it's linked neighbour(s) are also updated.
34+
35+
For more in depth information you can look at an [in depth explanation](https://github.com/domferr/tilingshell/issues/177#issuecomment-2458322208) of `group`(s).
36+
37+
Example JSON of a `Tile` object would look like this
38+
39+
```json
40+
{
41+
"x": 0,
42+
"y": 0,
43+
"width": 1,
44+
"height": 1,
45+
"groups": [
46+
1
47+
]
48+
}
49+
```
50+
51+
## Example JSON file
52+
53+
Finally, an example JSON file describing one Layout with two tiles.
54+
55+
```json
56+
{
57+
"id": "Equal split",
58+
"tiles": [
59+
{
60+
"x": 0,
61+
"y": 0,
62+
"width": 0.5,
63+
"height": 1,
64+
"groups": [
65+
1
66+
]
67+
},
68+
{
69+
"x": 0.5,
70+
"y": 0,
71+
"width": 0.5,
72+
"height": 1,
73+
"groups": [
74+
1
75+
]
76+
}
77+
]
78+
}
79+
```

esbuild.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class Extension {
1818
getSettings() {
1919
return imports.misc.extensionUtils.getSettings();
2020
}
21+
22+
static openPrefs() {
23+
return imports.misc.extensionUtils.openPrefs();
24+
}
2125
}
2226
2327
class Mtk { Rectangle }

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tilingshell",
3-
"version": "15.0",
3+
"version": "15.1",
44
"author": "Domenico Ferraro <[email protected]>",
55
"private": true,
66
"license": "GPL v2.0",

resources/icons/prefs-symbolic.svg

Lines changed: 3 additions & 0 deletions
Loading
977 Bytes
Binary file not shown.

resources/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"47"
1212
],
1313
"version": 99,
14-
"version-name": "15.0",
14+
"version-name": "15.1",
1515
"url": "https://github.com/domferr/tilingshell",
1616
"settings-schema": "org.gnome.shell.extensions.tilingshell",
1717
"gettext-domain": "tilingshell",

resources/schemas/org.gnome.shell.extensions.tilingshell.gschema.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
<summary>Restore window size</summary>
6868
<description>Restore the windows to their original size when untiled.</description>
6969
</key>
70+
<key name="enable-wraparound-focus" type="b">
71+
<default>true</default>
72+
<summary>Enable next/previous window focus to wrap around</summary>
73+
<description>When focusing next or previous window, wrap around at the window edge</description>
74+
</key>
7075
<key name="resize-complementing-windows" type="b">
7176
<default>true</default>
7277
<summary>Enable auto-resize of the complementing tiled windows</summary>
@@ -137,6 +142,11 @@
137142
<summary>Focused window border width</summary>
138143
<description>The width of the focused window's border.</description>
139144
</key>
145+
<key name="enable-smart-window-border-radius" type="b">
146+
<default>true</default>
147+
<summary>Enable smart window border radius</summary>
148+
<description>Dinamically adapt to the window's border radius.</description>
149+
</key>
140150
<key name="snap-assistant-animation-time" type="u">
141151
<default>180</default>
142152
<summary>Snap assistant animation time (milliseconds)</summary>
@@ -209,6 +219,14 @@
209219
<default><![CDATA[['']]]></default>
210220
<summary>Focus the window below the current focused window</summary>
211221
</key>
222+
<key type="as" name="focus-window-next">
223+
<default><![CDATA[['']]]></default>
224+
<summary>Focus the window next to the current focused window</summary>
225+
</key>
226+
<key type="as" name="focus-window-prev">
227+
<default><![CDATA[['']]]></default>
228+
<summary>Focus the window prior to the current focused window</summary>
229+
</key>
212230
</schema>
213231

214232
</schemalist>

src/components/editor/editableTilePreview.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export default class EditableTilePreview extends TilePreview {
1818
public static MIN_TILE_SIZE: number = 140;
1919

2020
private readonly _btn: St.Button;
21-
private readonly _tile: Tile;
2221
private readonly _containerRect: Mtk.Rectangle;
2322

2423
private _sliders: (Slider | null)[];
@@ -51,10 +50,6 @@ export default class EditableTilePreview extends TilePreview {
5150
this.connect('destroy', this._onDestroy.bind(this));
5251
}
5352

54-
public get tile(): Tile {
55-
return this._tile;
56-
}
57-
5853
public getSlider(side: St.Side): Slider | null {
5954
return this._sliders[side];
6055
}

0 commit comments

Comments
 (0)