You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Coming from the old ShellTile extension on an old Ubuntu version, I was looking for an up-to-date replacement for Gnome Shell 42.9 on Ubuntu 22.04, and I'm fond of this extension. Much more control, especially the ability to disable windows auto-rescaling.
However, the tiling activation areas, when moving a window to an edge, are a bit different from what I was used to and I wanted to changed them slightly.
So, in the hope that this little ad-hoc tweaking can help others too, here is how I managed to customize the left/right vertical "trigger" areas for half and quarter resizing:
Open up ~/.local/share/gnome-shell/extensions/[email protected]/extension.js
Line 1976: variable activationPercentage controls the area of a quarter resizing (in percentage). Setting this value to 0.1 for e.g. means that 10% of the vertical space from the top down, and 10% of the vertical space from the bottom up, will trigger a quarter resizing; while the 80% remaining vertical space in between will trigger a half resizing.
Personally I set this value to 0.3
Hit alt + f2 and run r to refresh your Gnome shell
To go further:
Variable quarterPercentage (line 1975) is a scaling parameter of the new sizes used for both quarter and half resizing.
By introducing new variables to separate the width and height control, you can more precisely control the new heights and widths of all corners and side centers:
// const quarterPercentage = 0.5 // Line 1975consttopleft_w=0.1;consttopleft_h=0.1;constbotleft_w=0.2;constbotleft_h=0.2;constcenterleft_w=0.9;// customconsttopright_w=0.3;consttopright_h=0.3;constbotright_w=0.4;constbotright_h=0.4;constcenterright_w=0.8;// custom// ... // Lines 1979 to 2011// previewRect.width = this._workArea.width * quarterPercentage; // Line 2012// previewRect.height = this._workArea.height * quarterPercentage;previewRect.y=this._workArea.y;// Left Sideif(x<=this._workArea.x+this._workArea.width/2){previewRect.x=this._workArea.x;if(isPointInsideRect({ x, y },topLeft)){previewRect.width=this._workArea.width*topleft_w// custompreviewRect.height=this._workArea.height*topleft_h;// customthis._activeEdgeTile=topLeft;}elseif(isPointInsideRect({ x, y },bottomLeft)){// previewRect.y = this._workArea.y + this._workArea.height - previewRect.height;previewRect.y=this._workArea.y+this._workArea.height-this._workArea.height*botleft_h;// custompreviewRect.height=this._workArea.height*botleft_h;// custompreviewRect.width=this._workArea.width*botleft_w// customthis._activeEdgeTile=bottomLeft;}elseif(y<=topRight.y+topRight.height){isCenterSide=true;}elseif(y<=bottomLeft.y){// vertical center leftpreviewRect.width=this._workArea.width*centerleft_w;// custom// previewRect.width = this._workArea.width * quarterPercentage; previewRect.height=this._workArea.height;this._activeEdgeTile.x=topLeft.x;this._activeEdgeTile.y=topLeft.y+topLeft.height;this._activeEdgeTile.height=bottomLeft.y-this._activeEdgeTile.y;this._activeEdgeTile.width=topLeft.width;}else{return;}// Right Side}else{isRightSide=true;previewRect.x=this._workArea.x+this._workArea.width-previewRect.width;if(isPointInsideRect({ x, y },topRight)){previewRect.x=this._workArea.x+this._workArea.width-this._workArea.width*topright_w;// custompreviewRect.width=this._workArea.width*topright_w;// custompreviewRect.height=this._workArea.height*topright_h;// customthis._activeEdgeTile=topRight;}elseif(isPointInsideRect({ x, y },bottomRight)){// previewRect.y = this._workArea.y + this._workArea.height - previewRect.height;previewRect.y=this._workArea.y+this._workArea.height-this._workArea.height*botright_h;// custompreviewRect.x=this._workArea.x+this._workArea.width-this._workArea.width*botright_w;// custompreviewRect.width=this._workArea.width*botright_w;// custompreviewRect.height=this._workArea.height*botright_h;// customthis._activeEdgeTile=bottomRight;}elseif(y<=topRight.y+topRight.height){isCenterSide=true;}elseif(y<=bottomRight.y){// vertical center rightpreviewRect.x=this._workArea.x+this._workArea.width-this._workArea.width*centerright_w;// custompreviewRect.width=this._workArea.width*centerright_w;// custom// previewRect.width = this._workArea.width * quarterPercentage;previewRect.height=this._workArea.height;this._activeEdgeTile.x=topRight.x;this._activeEdgeTile.y=topRight.y+topRight.height;this._activeEdgeTile.height=bottomRight.y-this._activeEdgeTile.y;this._activeEdgeTile.width=topRight.width;}else{return;}}
Added code lines are marked with a // custom comment. Original code lines are commented.
This is just re-using existing variables with different values, to fill a use case that might not even exist, but maybe it can help people who are curious but not used to manipulate Gnome extensions (as myself) 🙂
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Coming from the old ShellTile extension on an old Ubuntu version, I was looking for an up-to-date replacement for Gnome Shell 42.9 on Ubuntu 22.04, and I'm fond of this extension. Much more control, especially the ability to disable windows auto-rescaling.
However, the tiling activation areas, when moving a window to an edge, are a bit different from what I was used to and I wanted to changed them slightly.
So, in the hope that this little ad-hoc tweaking can help others too, here is how I managed to customize the left/right vertical "trigger" areas for half and quarter resizing:
~/.local/share/gnome-shell/extensions/[email protected]/extension.js
activationPercentage
controls the area of a quarter resizing (in percentage). Setting this value to 0.1 for e.g. means that 10% of the vertical space from the top down, and 10% of the vertical space from the bottom up, will trigger a quarter resizing; while the 80% remaining vertical space in between will trigger a half resizing.alt
+f2
and runr
to refresh your Gnome shellTo go further:
Variable
quarterPercentage
(line 1975) is a scaling parameter of the new sizes used for both quarter and half resizing.By introducing new variables to separate the width and height control, you can more precisely control the new heights and widths of all corners and side centers:
Added code lines are marked with a
// custom
comment. Original code lines are commented.This is just re-using existing variables with different values, to fill a use case that might not even exist, but maybe it can help people who are curious but not used to manipulate Gnome extensions (as myself) 🙂
Beta Was this translation helpful? Give feedback.
All reactions