Skip to content

Commit

Permalink
v8.0: custom activation keys, always show indicator during layout edi…
Browse files Browse the repository at this point in the history
…ting, share layouts
  • Loading branch information
domferr committed Jun 16, 2024
1 parent dd448bb commit b2743e4
Show file tree
Hide file tree
Showing 14 changed files with 515 additions and 380 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ To enable via the command line you can run
/usr/bin/gnome-extensions enable tilingshell@ferrarodomenico.com
```

To read the logs you can run

```bash
journalctl --follow /usr/bin/gnome-shell
```

### Uninstall Tiling Shell

To uninstall, first disable the extension and then remove it. To disable via the command line you can run
Expand Down
7 changes: 6 additions & 1 deletion esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ function init(meta) {

const prefsBanner = `// For GNOME Shell version before 45
class ExtensionPreferences {
constructor(metadata) {
this.metadata = metadata;
}
getSettings() {
return imports.misc.extensionUtils.getSettings();
}
Expand All @@ -47,7 +51,8 @@ function init() {
}
function fillPreferencesWindow(window) {
const prefs = new TilingShellExtensionPreferences();
const metadata = imports.misc.extensionUtils.getCurrentExtension().metadata;
const prefs = new TilingShellExtensionPreferences(metadata);
prefs.fillPreferencesWindow(window);
}
`;
Expand Down
137 changes: 1 addition & 136 deletions layouts.example.json
Original file line number Diff line number Diff line change
@@ -1,136 +1 @@
[
{
"id": "Layout 1",
"tiles": [
{
"x": 0,
"y": 0,
"width": 0.22,
"height": 0.5,
"groups": [
1,
2
]
},
{
"x": 0,
"y": 0.5,
"width": 0.22,
"height": 0.5,
"groups": [
1,
2
]
},
{
"x": 0.22,
"y": 0,
"width": 0.56,
"height": 1,
"groups": [
2,
3
]
},
{
"x": 0.78,
"y": 0,
"width": 0.22,
"height": 0.5,
"groups": [
3,
4
]
},
{
"x": 0.78,
"y": 0.5,
"width": 0.22,
"height": 0.5,
"groups": [
3,
4
]
}
]
},
{
"id": "Layout 2",
"tiles": [
{
"x": 0,
"y": 0,
"width": 0.22,
"height": 1,
"groups": [
1
]
},
{
"x": 0.22,
"y": 0,
"width": 0.56,
"height": 1,
"groups": [
1,
2
]
},
{
"x": 0.78,
"y": 0,
"width": 0.22,
"height": 1,
"groups": [
2
]
}
]
},
{
"id": "Layout 3",
"tiles": [
{
"x": 0,
"y": 0,
"width": 0.33,
"height": 1,
"groups": [
1
]
},
{
"x": 0.33,
"y": 0,
"width": 0.67,
"height": 1,
"groups": [
1
]
}
]
},
{
"id": "Layout 4",
"tiles": [
{
"x": 0,
"y": 0,
"width": 0.67,
"height": 1,
"groups": [
1
]
},
{
"x": 0.67,
"y": 0,
"width": 0.33,
"height": 1,
"groups": [
1
]
}
]
}
]
[{"id":"Layout 1","tiles":[{"x":0,"y":0,"width":0.22,"height":0.5,"groups":[1,2]},{"x":0,"y":0.5,"width":0.22,"height":0.5,"groups":[1,2]},{"x":0.22,"y":0,"width":0.56,"height":1,"groups":[2,3]},{"x":0.78,"y":0,"width":0.22,"height":0.5,"groups":[3,4]},{"x":0.78,"y":0.5,"width":0.22,"height":0.5,"groups":[3,4]}]},{"id":"Layout 2","tiles":[{"x":0,"y":0,"width":0.22,"height":1,"groups":[1]},{"x":0.22,"y":0,"width":0.56,"height":1,"groups":[1,2]},{"x":0.78,"y":0,"width":0.22,"height":1,"groups":[2]}]},{"id":"Layout 3","tiles":[{"x":0,"y":0,"width":0.33,"height":1,"groups":[1]},{"x":0.33,"y":0,"width":0.67,"height":1,"groups":[1]}]},{"id":"Layout 4","tiles":[{"x":0,"y":0,"width":0.67,"height":1,"groups":[1]},{"x":0.67,"y":0,"width":0.33,"height":1,"groups":[1]}]}]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tilingshell",
"version": "7.0.0",
"version": "8.0",
"author": "Domenico Ferraro <ferraro.domenico125@gmail.com>",
"private": true,
"license": "GPL v2.0",
Expand Down
3 changes: 2 additions & 1 deletion resources/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"45",
"46"
],
"version": 7,
"version": 8,
"version-name": "8.0",
"url": "https://github.com/domferr/tilingshell",
"settings-schema": "org.gnome.shell.extensions.tilingshell",
"donations": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<schemalist gettext-domain="gnome-shell-extensions">

<schema path="/org/gnome/shell/extensions/tilingshell/" id="org.gnome.shell.extensions.tilingshell">
<key name="last-version-installed" type="u">
<default>0</default>
<key name="last-version-name-installed" type="s">
<default>"0"</default>
<summary>Last version installed</summary>
<description>Last version installed of this extension.</description>
</key>
Expand All @@ -12,6 +12,11 @@
<summary>Enable tiling system</summary>
<description>Hold CTRL while moving a window to tile it.</description>
</key>
<key name="tiling-system-activation-key" type="as">
<default>[]</default>
<summary>Tiling system activation key</summary>
<description>Which key to hold while moving a window to activate the tiling system.</description>
</key>
<key name="enable-snap-assist" type="b">
<default>true</default>
<summary>Enable snap assist</summary>
Expand All @@ -37,6 +42,11 @@
<summary>Span multiple tiles</summary>
<description>Hold ALT to span multiple tiles.</description>
</key>
<key name="span-multiple-tiles-activation-key" type="as">
<default>[]</default>
<summary>Key to span multiple tiles</summary>
<description>Which key to hold to span multiple tiles.</description>
</key>
<key name="layouts-json" type="s">
<default>'[]'</default>
<summary>Layouts</summary>
Expand Down
3 changes: 2 additions & 1 deletion src/components/snapassist/snapAssist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ class SnapAssistContent extends St.BoxLayout {
}
}

const size = this._isEnlarged ? this.height:(this.height/2);
const distanceWhenOpen = 8;
const size = this._isEnlarged ? (this.height + distanceWhenOpen):(this.height/2);
const isNear = this.isBetween(this._container.x + this.x - this._activationAreaOffset, currPointerPos.x, this._container.x + this.x + this.width + this._activationAreaOffset)
&& this.isBetween(this._container.y - this._activationAreaOffset, currPointerPos.y, this._container.y + this._enlargedVerticalDistance + size + this._activationAreaOffset);

Expand Down
2 changes: 2 additions & 0 deletions src/components/tilepreview/selectionTilePreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export default class SelectionTilePreview extends TilePreview {
this._recolor();
});
this.connect("destroy", () => St.ThemeContext.get_for_stage(global.get_stage()).disconnect(styleChangedSignalID));
this._rect.width = this.gaps.left + this.gaps.right;
this._rect.height = this.gaps.top + this.gaps.bottom;
}

_init() {
Expand Down
Loading

0 comments on commit b2743e4

Please sign in to comment.