Skip to content

Commit

Permalink
Merge pull request #1 from jadbox/tile-only
Browse files Browse the repository at this point in the history
tile merge
  • Loading branch information
jadbox authored Aug 16, 2019
2 parents 2aad584 + 8c21b26 commit 44d2234
Show file tree
Hide file tree
Showing 32 changed files with 1,188 additions and 757 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.vscode
.vscode
node_modules/
package.json
yarn.lock
14 changes: 14 additions & 0 deletions assets/icons/tiling/split-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 30 additions & 3 deletions extension.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const { GLib } = imports.gi;
const Main = imports.ui.main;
const Signals = imports.signals;

const Me = imports.misc.extensionUtils.getCurrentExtension();
const {
DisableIncompatibleExtensionsModule
Expand All @@ -11,22 +14,24 @@ const { RequiredSettingsModule } = Me.imports.module.requiredSettingsModule;
const { TilingModule } = Me.imports.module.tilingModule;
const { StateManager } = Me.imports.stateManager;

let disableIncompatibleExtensionsModule, modules;
let disableIncompatibleExtensionsModule, modules, _startupPreparedId;

// eslint-disable-next-line no-unused-vars
function init() {
log('--------------');
log('INIT EXTENSION');
log('--------------');
Signals.addSignalMethods(Me);
global.materialShell = Me;
Me.stateManager = new StateManager();
Me.loaded = false;
disableIncompatibleExtensionsModule = new DisableIncompatibleExtensionsModule();
modules = [
new RequiredSettingsModule(),
new LeftPanelModule(),
// new LeftPanelModule(),
new TilingModule(),
new SuperWorkspaceModule(),
new NoTitleBarModule(),
// new NoTitleBarModule(),
new HotKeysModule()
];
}
Expand All @@ -36,6 +41,7 @@ function enable() {
log('----------------');
log('ENABLE EXTENSION');
log('----------------');
Main.wm._blockAnimations = true;
//Delay to wait for others extensions to load first;
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
//Then disable incompatibles extensions;
Expand All @@ -44,11 +50,31 @@ function enable() {
modules.forEach(module => {
module.enable();
});
if (Main.layoutManager._startingUp) {
_startupPreparedId = Main.layoutManager.connect(
'startup-complete',
() => loaded(true)
);
} else {
loaded(false);
}
});
return GLib.SOURCE_REMOVE;
});
}

function loaded(disconnect) {
log('----------------');
log('EXTENSION LOADED');
log('----------------');
if (disconnect) {
Main.layoutManager.disconnect(_startupPreparedId);
}
Me.loaded = true;
Main.wm._blockAnimations = false;
Me.emit('extension-loaded');
}

// eslint-disable-next-line no-unused-vars
function disable() {
log('----------------');
Expand All @@ -57,4 +83,5 @@ function disable() {
modules.reverse().forEach(module => {
module.disable();
});
Me.loaded = false;
}
Binary file modified gschemas.compiled
Binary file not shown.
27 changes: 21 additions & 6 deletions layouts.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<schemalist>
<schema id="org.gnome.shell.extensions.materialshell.layouts" path="/org/gnome/shell/extensions/materialshell/layouts/">
<key name="maximize" type="b">
<default>true</default>
<default>false</default>
<summary>Maximize layout</summary>
<description>Maximize all windows</description>
</key>
<key name="split" type="b">
<default>false</default>
<summary>Split layout</summary>
<description>Put all windows side by side, two at a time</description>
</key>
<key name="half" type="b">
<default>true</default>
<default>false</default>
<summary>Half layout</summary>
<description>Tile windows according to screen ratio</description>
</key>
Expand All @@ -21,12 +26,12 @@
<description>Tile windows vertically</description>
</key>
<key name="ratio" type="b">
<default>false</default>
<default>true</default>
<summary>Ratio based grid layout</summary>
<description>Tile windows in both way according to the ratio of the remaining space</description>
</key>
<key name="ratio-value" type="d">
<default>0.6180339887498948</default>
<default>0.45</default>
<summary>Ratio of the ratio layout</summary>
<description>Determines the ratio of the tiling</description>
</key>
Expand All @@ -36,7 +41,7 @@
<description>Tile windows according to a regular grid</description>
</key>
<key name="float" type="b">
<default>false</default>
<default>true</default>
<summary>Float layout</summary>
<description>No tiling is done, windows are floating freely</description>
</key>
Expand All @@ -56,10 +61,20 @@
<description>Split screen vertically</description>
</key>
<key name="gap" type="i">
<default>0</default>
<default>8</default>
<summary>Gap size around tiled windows</summary>
<description>Determines the gap size between windows</description>
</key>
<key name="use-screen-gap" type="b">
<default>true</default>
<summary>Use a different gap size for screen</summary>
<description>Determines whether to use the screen gap config</description>
</key>
<key name="screen-gap" type="i">
<default>48</default>
<summary>Screen gap size around tiled windows</summary>
<description>Determines the screen edge gap size between windows</description>
</key>
<key name="tween-time" type="d">
<default>0.25</default>
<summary>Animation duration</summary>
Expand Down
4 changes: 2 additions & 2 deletions module/requiredSettingsModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ var RequiredSettingsModule = class RequiredSettingsModule {
schema_id: 'org.gnome.mutter'
});
this.settingsToForce = [
{
/* {
schema: 'org.gnome.mutter',
key: 'dynamic-workspaces',
value: false,
valueType: 'boolean'
},
}, */
{
schema: 'org.gnome.mutter',
key: 'workspaces-only-on-primary',
Expand Down
Loading

0 comments on commit 44d2234

Please sign in to comment.