Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Gnome 45 #605

Merged
merged 58 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3781e62
Ported App.js to ESM.
jtaala Sep 15, 2023
5b48bf1
WIP: porting `extensions.js`.
jtaala Sep 15, 2023
5695014
Merge branch 'release' into gnome-45
jtaala Sep 15, 2023
7a2e986
Ported `extensions.js` to ESM. Using centralised imports file (which
jtaala Sep 16, 2023
4d5eb16
Ported app.js.
jtaala Sep 16, 2023
8bfd5c7
Ported gestures.js. Allow shadowing in eslint.
jtaala Sep 16, 2023
6390718
Ported grab.js.
jtaala Sep 16, 2023
4b4ce37
Ported settings.js.
jtaala Sep 16, 2023
e07315b
Ported keybindings.js to ESM imports.
jtaala Sep 16, 2023
16bc95f
Export functions in lib.js.
jtaala Sep 16, 2023
8bde99a
Ported liveAltTab to ESM imports.
jtaala Sep 16, 2023
864f8d2
Ported minimap.js to ESM.
jtaala Sep 16, 2023
f8a982a
Ported Utils.js to ESM.
jtaala Sep 16, 2023
0e82967
Ported navigator.js.
jtaala Sep 16, 2023
4619105
Ported scratch.js.
jtaala Sep 16, 2023
bc38265
Ported patches.js.
jtaala Sep 16, 2023
ebbb5b8
Ported workspace.js.
jtaala Sep 16, 2023
2ff0c71
Ported topbar.js.
jtaala Sep 16, 2023
6b46b84
Ported stackoverlay.js
jtaala Sep 16, 2023
6bfd7ed
First attempt at porting tiling.js to ESM.
jtaala Sep 16, 2023
6572579
Updated shell version to "45".
jtaala Sep 17, 2023
40e6ad3
Lots of import related fixes.
jtaala Sep 17, 2023
a513392
Migrated all debug calls to `console.debug`.
jtaala Sep 17, 2023
75b7bb7
Removed old/unused debug functions.
jtaala Sep 17, 2023
e6316fe
Fixes for exports and also now that ESM, only parent modules can change
jtaala Sep 17, 2023
7efa78a
FIXES: exports, and replace Meta.Rectangle. Also removed several
jtaala Sep 17, 2023
210b96e
Removed deprecated `global.screen` (pre gnome 40).
jtaala Sep 17, 2023
36d944a
Removed `dynamic_funtion_ref` approach and using ESM module references
jtaala Sep 17, 2023
6baba32
Improved module dependency ordering for `disable` to avoid actioning a
jtaala Sep 18, 2023
3c1a690
WIP: prefs.js
jtaala Sep 18, 2023
d2aaab8
WIP: keybindings_pane, passing keyboard settings schema.
jtaala Sep 18, 2023
a5709d8
Pres.js window improvements.
jtaala Sep 19, 2023
53155a9
Large pref.js clean and refactored functions into class.
jtaala Sep 19, 2023
036cadd
Migrated workspace.js to WorkspaceSettings class.
jtaala Sep 19, 2023
92dce50
Classifying AccleratorParse.
jtaala Sep 19, 2023
89c7bee
Added note re `user.js` not working Gnome 45. Now supplying a
jtaala Sep 19, 2023
b53b9cb
Updated ego generation script to include user.css example file.
jtaala Sep 19, 2023
6dbd241
Updated default vertical margins.
jtaala Sep 19, 2023
a4ac98c
Update README.md with gnome-45 related stuff.
jtaala Sep 23, 2023
8988345
Merge branch 'release' into gnome-45
jtaala Sep 23, 2023
2b26cdf
FIX: for `use-workspace-name` issue (that can cause PaperWM to not
jtaala Sep 24, 2023
efc51c0
FIX: if hide workspace indicator `show-workspace-indicator` is false ==>
jtaala Sep 24, 2023
13bf8fb
Remove `use-workspace-name` deprecated preference.
jtaala Sep 24, 2023
41c3784
Workspace indicator mouse scrolling now sequence.
jtaala Sep 24, 2023
e6b9e54
FIX: for FocusIcon on spaces.
jtaala Sep 24, 2023
aef81ca
FIX: moving windows in workspace sequence (regression).
jtaala Sep 24, 2023
42c821f
FIX #608.
jtaala Sep 29, 2023
7237404
Merge branch 'fix-608-overview-minimize-on-close-app-gnome-crash' int…
jtaala Sep 29, 2023
96b3cb2
Merge branch 'fix-608-overview-minimize-on-close-app-gnome-crash' int…
jtaala Sep 29, 2023
e14cdb5
Merge branch 'fix-liveAltTab-size-scales-with-minimap' into gnome-45
jtaala Sep 30, 2023
55b48ee
Merge branch 'feature-add-other-preview-scaling-prefs' into gnome-45
jtaala Sep 30, 2023
9ace145
FIXES to minimap sizing and label placement.
jtaala Oct 2, 2023
825d2a5
FIXES: removed "opacity" actor hack for opening animations. Essentially
jtaala Oct 4, 2023
1b3a9cc
Removed opening animation easer.
jtaala Oct 4, 2023
b56d2bd
Merge branch 'fix-opening-animation-glitches' into gnome-45
jtaala Oct 4, 2023
ffe4092
Merge branch 'fix-minimap-sizing' into gnome-45
jtaala Oct 4, 2023
0164abb
Added option to use Gnome workspace indicator pill.
jtaala Oct 4, 2023
ca62ca5
Moved prefs "Settings" box to the top of general tab (most used
jtaala Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ rules:
no-return-assign: error
no-return-await: error
no-self-compare: error
no-shadow: error
no-shadow-restricted-names: error
no-spaced-func: error
no-tabs: error
Expand Down Expand Up @@ -277,3 +276,4 @@ globals:
clearInterval: readonly
parserOptions:
ecmaVersion: 2022
sourceType: module
57 changes: 19 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# PaperWM #

> ### ⚠️ PaperWM [`develop`](https://github.com/paperwm/PaperWM/tree/develop) and [`release`](https://github.com/paperwm/PaperWM/tree/release) branches are now on Gnome 45.
>
> ### If you're using Gnome 42-44, please install via [extensions.gnome.org](https://extensions.gnome.org/extension/6099/paperwm/) OR use the [`gnome-44`](https://github.com/paperwm/PaperWM/tree/gnome-44) branch (see the [Installation](#installation) section for more information).

[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://paperwm.zulipchat.com)

PaperWM is a [Gnome Shell](https://wiki.gnome.org/Projects/GnomeShell) extension which provides scrollable tiling of windows and per monitor workspaces. It's inspired by paper notebooks and tiling window managers.

Supports Gnome Shell from 3.28 to 44 on X11 and wayland.
Can be installed on Gnome Shells from 3.28 to 45 on X11 and wayland.

_While PaperWM can be installed on a wide range of Gnome versions, new features aren't generally backported to versions NOT targeted for current support (see [Installation](#installation) section). Fixes may be backported on request (please submit a [new issue](https://github.com/paperwm/PaperWM/issues/new/choose) if you've identified a recent fix that should be backported and you can help with testing)._
_While PaperWM can be installed on a wide range of Gnome versions, new features aren't generally backported to previous versions. Fixes may be backported on request (please submit a [new issue](https://github.com/paperwm/PaperWM/issues/new/choose) if you've identified a recent fix that should be backported and you can help with testing)._

While technically an [extension](https://wiki.gnome.org/Projects/GnomeShell/Extensions) it's to a large extent built on top of the Gnome desktop rather than merely extending it.

Expand All @@ -22,7 +26,8 @@ We often hang out on [zulip](https://paperwm.zulipchat.com).

Clone the repo and check out the branch supporting the Gnome Shell version you're running.

- 42-44 (targeted for current support): https://github.com/paperwm/PaperWM/tree/release
- 45 (current Gnome Shell release): https://github.com/paperwm/PaperWM/tree/release
- 42-44: https://github.com/paperwm/PaperWM/tree/gnome-44
- 40-41: https://github.com/paperwm/PaperWM/tree/gnome-40
- 3.28-3.38: https://github.com/paperwm/PaperWM/tree/gnome-3.38

Expand Down Expand Up @@ -59,7 +64,7 @@ Users are enouraged to submit [issues](https://github.com/paperwm/PaperWM/issues

Most functionality is available using a mouse, eg. activating a window at the edge of the monitor by clicking on it. In wayland its possible to navigate with 3-finger swipes on the trackpad. But the primary focus is making an environment which works well with a keyboard.

All keybindings start with the <kbd>Super</kbd> modifier. On most keyboards it's the Windows key, on mac keyboards it's the Command key. It's possible to modify the keyboard layout so that <kbd>Super</kbd> is switched with <kbd>Alt</kbd> making all the keybindings easier to reach. This can be done through Gnome Tweaks under `Keybard & Mouse` ⟶ `Additional Layout Options` ⟶ `Alt/Win key behavior` ⟶ `Left Alt is swapped with Left Win`.
Most keybindings start with the <kbd>Super</kbd> modifier (by default), which is usually the Windows key, or on mac keyboards it's the Command key. It's possible to modify the keyboard layout so that <kbd>Super</kbd> is switched with <kbd>Alt</kbd> making all the keybindings easier to reach. This can be done through Gnome Tweaks under `Keybard & Mouse` ⟶ `Additional Layout Options` ⟶ `Alt/Win key behavior` ⟶ `Left Alt is swapped with Left Win`.

Most keybindings will grab the keyboard while <kbd>Super</kbd> is held down, only switching focus when <kbd>Super</kbd> is released. <kbd>Escape</kbd> will abort the navigation taking you back to the previously active window.

Expand Down Expand Up @@ -172,6 +177,10 @@ When the tiling is active <kbd>Super</kbd><kbd>Shift</kbd><kbd>Tab</kbd> selects

## User configuration & development ##

> ### ⚠️ Gnome 45 removed the ability to add external module files to the search path of extensions. Hence, modifications to PaperWM via `user.js` is [not currently available in Gnome 45](https://github.com/paperwm/PaperWM/issues/576#issuecomment-1721315729).
>
> `user.js` functionality is still available in PaperWM for previous Gnome shell versions.

A default user configuration, `user.js`, is created in `~/.config/paperwm/` with three functions `init`, `enable` and `disable`. `init` will run only once on startup, `enable` and `disable` will be run whenever extensions are being told to disable and enable themselves.

You can also supply a custom `user.css` in `~/.config/paperwm/`. This user stylesheet can override the default styles of paperwm (e.g. from `~/.local/share/gnome-shell/extensions/[email protected]/user.css` or `/usr/share/gnome-shell/extensions/[email protected]/user.css`), gnome or even other extensions. The same rules as for CSS in the browser apply (i.e. CSS rules are additive).
Expand Down Expand Up @@ -268,15 +277,9 @@ Setting | Description | Reference
--------|-------------|----------
<code>show&#8209;workspace&#8209;indicator</code>| Shows/hides the workspace indicator element in Topbar. | See [The workspace stack & monitors](#the-workspace-stack--monitors).

Setting | Description | Input Type | Default value
--------|-------------|------------|--------------
<code>use&#8209;workspace&#8209;name</code> | Use PaperWM workspace name in workspace indicator in the TopBar. Setting to false uses the gnome default name (i.e. `Activities`). | _Boolean_ | `true`

_Note: this does not disable the workspace indicator, but simply makes it looks like default gnome `Activities` button. To show/hide the workspace indicator element use setting_ `show-workspace-indicator`.

__Example:__
```
dconf write /org/gnome/shell/extensions/paperwm/use-workspace-name false
dconf write /org/gnome/shell/extensions/paperwm/show-workspace-indicator false
```

Setting | Description | Input Type | Default value
Expand All @@ -300,32 +303,6 @@ https://user-images.githubusercontent.com/30424662/211422647-79e64d56-5dbb-4054-

The `wm_class` or `title` of a window can be found by using looking glass: <kbd>Alt</kbd><kbd>F2</kbd> `lg` <kbd>Return</kbd> Go to the "Windows" section at the top right and find the window. X11 users can also use the `xprop` command line tool (`title` is referred as `WM_NAME` in `xprop`). The match of `wm_class` and `title` are with an OR condition; and in addition to a plain string matching, a constructed [`RegExp()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp) can be used to utilise regex matching. For example, e.g. `/.*terminal.*/i` would match on any value that contains the word "terminal" (case-insensitive).



Alternatively, you can also define winprops in the `user.js` configuration file. Below is a few examples of setting window properties for _Spotify_ and _Alacritty_. The below examples are best placed in the `init` part of `user.js`:

```javascript
Tiling.defwinprop({
wm_class: "Spotify",
title: "Window Title",
scratch_layer: true,
});

Tiling.defwinprop({
wm_class: "firefox",
preferredWidth: "900px",
});

Tiling.defwinprop({
wm_class: /alacritty/i,
preferredWidth: "50%",
});
```

_Note<sup>1</sup>: `Winprops` defined in the PaperWM extension settings take precedence over `Winprops` defined using the `user.js` method._

_Note<sup>2</sup>: if you use the `user.js` method you will need to restart Gnome shell to have them take effect._

### Setting a default window property rule

You can use the functionality defined in the [setting window specific properities](#setting-window-specific-properties) section to define a `default` window property rule that will be applied to all windows NOT matched by a more specific window property rule.
Expand All @@ -338,6 +315,8 @@ This special operator is at a lower precedence, so more specific properties that

### New Window Handlers

> #### ⚠️ Gnome 45 removed the ability to add external module files to the search path of extensions. Hence, the below `user.js` functionality is not currently available in Gnome 45.

If opening a new application window with <kbd>Super</kbd><kbd>Return</kbd> isn't doing exactly what you want, you can create custom functions to suit your needs. For example, you might want new emacs windows to open the current buffer by default, or have new terminals inherit the current directory. To implement this, you can modify `user.js` as below (see [User configuration & development](#user-configuration--development) section):

```javascript
Expand Down Expand Up @@ -375,6 +354,8 @@ Due to limitations in the mutter keybinding API we need to steal some built in G

#### User defined keybindings

> #### ⚠️ Gnome 45 removed the ability to add external module files to the search path of extensions. Hence, the below `user.js` and `examples/keybindings.js` functionality is not currently available in Gnome 45.

`Extension.imports.keybindings.bindkey(keystr, name, handler, options)`

Option | Values | Meaning
Expand Down Expand Up @@ -508,7 +489,7 @@ There's a few Gnome Shell settings which works poorly with PaperWM. Namely
- `edge-tiling`: We don't support the native half tiled windows
- `attach-modal-dialogs`: Attached modal dialogs can cause visual glitching

PaperWM manages these settings (disables them) during runtime. It will then restore these settings to their prior values (before PaperWM was enabled).
PaperWM manages these settings (disables them) during runtime. It will then restore these settings to their prior values when PaperWM is disabled.

## Recommended extensions ##

Expand Down
Loading