Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/paperwm/PaperWM

Tiled scrollable window management for Gnome Shell
https://github.com/paperwm/PaperWM

gnome-shell-extension tiling-window-manager window-manager

Last synced: about 2 months ago
JSON representation

Tiled scrollable window management for Gnome Shell

Awesome Lists containing this project

README

        

# PaperWM #

[![project chat](https://img.shields.io/badge/PaperWM_Discussions-join_chat-brightgreen)](https://github.com/paperwm/PaperWM/discussions)

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

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

PaperWM aims to continually support [current stable](https://release.gnome.org/calendar/#branches) Gnome shell versions (currently Gnome 45 & Gnome 46). Older versions of PaperWM can generally be installed on older Gnome Shell versions (see [Install via Source](#install-via-source) for more information on targeting an older/EOL Gnome version).

New features and fixes aren't generally backported to older Gnome shell versions. [Pull requests](https://github.com/paperwm/PaperWM/pulls) for fixes to older PaperWM versions (that run on previous Gnome versions) will be accepted if the submitter can help test and update related documentation.

Have questions or comments? Please ask on our [Github Discussions](https://github.com/paperwm/PaperWM/discussions) board.

## Installation

### Install via [extensions.gnome.org](https://extensions.gnome.org/extension/6099/paperwm/) (recommended)

[Intall it on extensions.gnome.org](https://extensions.gnome.org/extension/6099/paperwm/)

### Install via Source

Clone the repo and check out the branch for the Gnome Shell version you're running:

- 45-46 (currently developed/supported): https://github.com/paperwm/PaperWM/tree/release
- 42-44 ([EOL](https://release.gnome.org/calendar/#releases)): https://github.com/paperwm/PaperWM/tree/gnome-44
- 40-41 ([EOL](https://release.gnome.org/calendar/#releases)): https://github.com/paperwm/PaperWM/tree/gnome-40
- 3.28-3.38 ([EOL](https://release.gnome.org/calendar/#releases)): https://github.com/paperwm/PaperWM/tree/gnome-3.38

then run the [`install.sh`](https://github.com/paperwm/PaperWM/blob/release/install.sh) script
from the repository. The installer will create a link to the repo in
`~/.local/share/gnome-shell/extensions`. It will then ask if you want to enable PaperWM.
```bash
./install.sh # install, load and enable paperwm
```
> #### ➡️ You'll need to restart Gnome shell after installing PaperWM, e.g. logout then login, or restart in place with an `alt-F2` and entering `r` (X11 only).
>
> After logging back in, you can then enable PaperWM via the `Extensions` application, or by running the following command from the command-line:
>
> ```bash
> /usr/bin/gnome-extensions enable [email protected]
> ```

> if you have run into issues, delete any older `paperwm@...` symlinks from `~/.local/share/gnome-shell/extensions` and re-run the `install.sh` script.

#### Uninstall PaperWM (if installed via source)
To uninstall simply run `./uninstall.sh`.

Running the extension will automatically install a user config file as described in [User configuration & development](#user-configuration--development).

## Contributing
Users are enouraged to submit [issues](https://github.com/paperwm/PaperWM/issues/new/choose) and [Pull Requests](https://github.com/paperwm/PaperWM/pulls)!

> #### ➡️ Please ensure pull requests are based off, and submitted to, [develop](https://github.com/paperwm/PaperWM/tree/develop) branch.
>
> Pull requests submitted to the `release` branch will not be accepted (but don't worry, if you accidentally submit a PR to the `release` branch, the target branch will automatically be changed to `develop` branch).

## Usage ##

Most functionality is available using a mouse, eg. activating a window at the edge of the monitor by clicking on it. Wayland support gestures (See the [Touchpad Gestures](#touchpad-gestures) section). PaperWM is designed to work work well with keyboard + mouse, trackpads etc.

Most keybindings start with the Super 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 Super is switched with Alt 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 Super is held down, only switching focus when Super is released. Escape will abort the navigation taking you back to the previously active window.

All PaperWM keybinds can be changed (and disabled) via PaperWM extension settings.

Window management and navigation is based around the three following concepts.

### Scrollable window tiling ###

![The window tiling with the minimap shown](https://github.com/paperwm/media/blob/master/tiling.png)

New windows are automatically tiled to the right of the active window (see [here](#window-insertion-position-for-new-windows) for dynamically changing the insertion position of new windows), taking up as much height as possible. SuperReturn will open a new window of the same type as the active window.

Activating a window will ensure it's fully visible, scrolling the tiling if necessary. By default, pressing Super. activates the window to the right. Super, activates the window to the left. On a US keyboard these keys are intuitively marked by < and >, they are also ordered the same way on almost all keyboard layouts. Navigating around windows brings up the minimap as can be seen in the above screenshot. The minimap will stay visible as long as Super is continually being pressed.

Pressing SuperI will move the window to the right below the active window, tiling them vertically in a column. SuperO will do the opposite, pushing the bottom window out of the current column.

Swiping the trackpad horizontally with three fingers (only available in Wayland) or swiping the panel horizontally on a touch screen will scroll the tiling.

AltTab is of course also available.

| Default `window` Keybindings | _Can be changed in PaperWM extension settings_ |
| ------ | ------- |
| SuperReturn or SuperN | Open a new windows (of the current application) |
| SuperBackspace | Close the active window |
| Super. or Super, | Switch to the next or previous window |
| SuperLeft or SuperRight | Activate the window to the left or right |
| SuperUp or SuperDown | Activate the window above or below |
| SuperHome or SuperEnd | Activate the first or last window |
| _Not set by default (set in extension settings)_ | Switch to the [second _to_ eleventh] window |
| SuperTab or AltTab | Cycle through previously active windows |
| ShiftSuperTab or ShiftAltTab | Cycle through previously active windows (backward order) |
| CtrlAltTab | Cycle through previously active scratch windows |
| ShiftCtrlAltTab | Cycle through previously active scratch windows (backward order) |
| ShiftSuperC | Switch between window focus modes |
| ShiftSuperW | Switch between positions for creating new windows |
| _Not set by default (set in extension settings)_ | Create new windows to the right of current window |
| _Not set by default (set in extension settings)_ | Create new windows to the left of current window |
| _Not set by default (set in extension settings)_ | Create new windows in vertical stack (down) |
| _Not set by default (set in extension settings)_ | Create new windows in vertical stack (up) |
| _Not set by default (set in extension settings)_ | Create new windows at start position |
| _Not set by default (set in extension settings)_ | Create new windows at end position |
| SuperCtrl, or SuperCtrl. | Move the current window to the left or right |
| ShiftSuper, or ShiftSuper. | Move the current window to the left or right |
| SuperCtrlLeft or SuperCtrlRight | Move the current window to the left or right |
| SuperCtrlUp or SuperCtrlDown | Move the current window up or down |
| SuperI | Absorb window into the active column |
| SuperO | Expel the bottom window from vertically tiled windows |
| ShiftSuperO | Expel the active window from vertically tiled windows |
| SuperC | Center windows horizontally |
| ShiftSuperF | Toggle fullscreen |
| SuperF | Maximize the width of a window |
| ShiftSuper+ | Increment window height (scratch or vertically tiled windows) |
| ShiftSuper- | Decrement window height (scratch or vertically tiled windows) |
| Super+ | Increment window width |
| Super- | Decrement window width |
| SuperR | Resize the window (cycles through useful widths) |
| SuperAltR | Resize the window (cycles backwards through useful widths) |
| SuperShiftR | Resize the window (cycles through useful heights) |
| SuperShiftAltR | Resize the window (cycles backwards through useful heights) |
| Supert | Take window(s) dropping when finished navigating |
| _Not set by default (set in extension settings)_ | Activate the window under mouse cursor |

### The workspace stack & monitors ###

Pressing SuperAbove_Tab will slide the active workspace down revealing the stack as shown in the above screenshot. You can then flip through the most recently used workspaces with repeated Above_Tab presses while holding Super down. Above_Tab is the key above Tab (\` in a US qwerty layout). Like alt-tab Shift is added to move in reverse order:

![The most recently used workspace stack](https://github.com/paperwm/media/blob/master/stack.png)

Pressing SuperPage_Down and SuperPage_Up will slide between workspaces sequentially:

![Sequential workspace navigation](https://github.com/paperwm/media/blob/master/sequence.png)

By default SuperPage_Down and SuperPage_Down are bound to the keybindings "Switch to workspace below/above (**ws from current monitor**)". That means using the keybindings you can select all workspaces that were previously shown on the current monitor and all empty once.

Alternatively you can change these keybindings to "Switch to workspace below/above (**ws from all monitors**)" in the settings. That way you can switch to **all** workspaces (that are not currently shown on another monitor). Depending on your workflow this might feel more natural.

The workspace name is shown in the top left corner replacing the `Activities` button adding a few enhancements. Scrolling on the name will let you browse the workspace stack just like SuperAbove_Tab. Left clicking on the name opens Gnome overview, while right clicking the name lets you access and change the workspace name.

> If you prefer to use Gnome workspace "pill", you can replace the workspace name element, and enable the Gnome pill from the `General` section of PaperWM preferences:
>
> Using the Gnome pill

Swiping down on the trackpad vertically with three fingers will initiate the workspace stack, and then allow you navigate the workspace stack with 3-finger vertical swipes (only available in Wayland). See the [Touchpad Gestures](#touchpad-gestures) section for more information on gesture support in PaperWM.

There's a single scrollable tiling per workspace. Adding another monitor simply makes it possible to have another workspace visible. The workspace stack is shared among all the monitors, windows being resized vertically as necessary when workspace is displayed on another monitor.

| `workspace` keybindings | _Can be changed in PaperWM extension settings_ |
| ------ | ------- |
| Super\` | Switch to previously active workspace |
| ShiftSuper\` | Switch to previously active workspace (backwards order) |
| CtrlSuper\` | Move active window to previously active workspace |
| ShiftCtrlSuper\` | Move active window to previously active workspace (backwards order) |
| SuperPageUp | Switch to workspace above |
| SuperPageDown | Switch to workspace below |
| CtrlSuperPageUp | Move active window one workspace up |
| CtrlSuperPageDown | Move active window one workspace down |
| CtrlSuperB | Toggle show/hide (GNOME) TopBar and Window Position Bar |
| _Not set by default (set in extension settings)_ | Toggle show/hide (GNOME) TopBar |
| _Not set by default (set in extension settings)_ | Toggle show/hide Window Position Bar |

| `monitor` keybindings | _Can be changed in PaperWM extension settings_ |
| ------ | ------- |
| SuperShiftRight | Switch to the right monitor |
| SuperShiftLeft | Switch to the left monitor |
| SuperShiftUp | Switch to the above monitor |
| SuperShiftDown | Switch to the below monitor |
| ShiftCtrlAltRight | Move workspace to monitor on the right |
| ShiftCtrlAltLeft | Move workspace to monitor on the left |
| ShiftCtrlAltUp | Move workspace to monitor above |
| ShiftCtrlAltDown | Move workspace to monitor below |
| SuperAltRight | Swap workspace with monitor to the right |
| SuperAltLeft | Swap workspace with monitor to the left |
| SuperAltUp | Swap workspace with monitor above |
| SuperAltDown | Swap workspace with monitor below |
| ShiftCtrlSuperRight | Move active window to the right monitor |
| ShiftCtrlSuperLeft | Move active window to the left monitor |
| ShiftCtrlSuperUp | Move active window to the above monitor |
| ShiftCtrlSuperDown | Move active window to the below monitor |

### Scratch layer ###

![The floating scratch layer, with the alt tab menu open](https://github.com/paperwm/media/blob/master/scratch.png)

The scratch layer is an escape hatch to a familiar floating layout. This layer is intended to store windows that are globally useful like chat applications and in general serve as the kitchen sink.
When the scratch layer is active it will float above the tiled windows, when hidden the windows will be minimized.

Pressing SuperEscape toggles between showing and hiding the windows in the scratch layer.
Activating windows in the scratch layer is done using SuperTab, the floating windows having priority in the list while active.
When the tiling is active SuperShiftTab selects the most recently used scratch window.

SuperCtrlEscape will move a tiled window into the scratch layer or alternatively tile an already floating window. This functionality can also be accessed through the window context menu (AltSpace).

| `scratch` keybindings | _Can be changed in PaperWM extension settings_ |
| ------ | ------- |
| ShiftSuperEscape | Toggles the floating scratch layer |
| CtrlSuperEscape | Attach/detach active window into scratch layer |
| SuperEscape | Toggle the most recent scratch window |

## Touchpad Gestures ###

PaperWM implements the following touchpad gestures by default:

Gesture | Action
------------------------------|------------------------------------------------------
three-finger swipe up | Gnome Overview
three-finger swipe down | PaperWM workspace stack view (see [here](#the-workspace-stack--monitors))
three-finger swipe left/right | Moves tiling viewport (windows) left / right

PaperWM touchpad gesture behaviour can be modified via the `General` tab in PaperWM settings:

Touchpad gesture settings

## Window Position Bar (colored bar segment in Top Bar) ##

[#476](https://github.com/paperwm/PaperWM/pull/476) added a coloured window position bar to the Gnome Top Bar. This allows users to visually identify the current selected window position of the scrollable viewport in the current workspace. This is demonstrated in the following video:

https://user-images.githubusercontent.com/30424662/221416159-464d7512-5174-451b-9035-0ee84f9eb4ec.mp4

The window position bar can be _disabled_ from `PaperWM extension settings`:

Window indicator bar

You can style both the coloured position bar and the dimmed "position bar backdrop" by overriding the `paperwm-window-position-bar` and `paperwm-window-position-bar-backdrop` CSS classes respectively (see `user.css` in [User configuration & development](#user-configuration--development) section for more information). The `paperwm-window-position-bar` will also inherit the selection color (same as window borders) from `tile-preview`.

_Note: PaperWM overrides the default Gnome Top Bar style to be completely transparent so that the dimmed `window-position-bar-backdrop` and `window-position-bar` elements are visible._

## Window Focus Modes ##

[#482](https://github.com/paperwm/PaperWM/pull/482) added the concept of `window focus modes` to PaperWM. A `focus mode` controls how windows are "focused". The following modes are currently available:

- the `DEFAULT` focus mode is the traditional PaperWM behaviour (no snapping, just free scrolling)
- the `CENTER` focus mode causes all windows to be centered horizontally on selection
- the `EDGE` focus mode causes windows to snap to the closest edge horizontally on selection (but while there is only one window, it is centered)

Focus modes can be toggled by user-settable keybinding (default is `Super`+`Shift`+`c`), or by clicking the new focus-mode button in the Top Bar:

![Focus mode button](media/focus-mode-button.png)

### Setting the default focus mode

The default focus mode is the standard PaperWM focus mode (i.e. not centered). This can be changed according to preference by changing the `Default focus mode` setting PaperWM settings.

Default focus mode

_Note: changing this setting during a PaperWM session will set all spaces to the new default focus mode._

### Hiding the focus mode icon

Users may also prefer to hide the focus mode icon. You can do so from the `Avanced` tab in PaperWM extension settings:

Hiding the focus mode icon

## Setting window specific properties

It's possible to set window properties using simple rules that will be applied when placing new windows. Properties can applied to windows identified by their `wm_class` or `title`. The following properties are currently supported:

Property | Input type | Input example | Description
----------------------|-------------------------------------|------------------|------------------
`scratch_layer` | Boolean | `true`, `false` | if `true` window will be placed on the scratch layer.
`preferredWidth` | String value with `%` or `px` unit | `"50%"`, `"450px"` | resizes the window width to the preferred width when it's created. _Note1: property not applicable to windows on scratch layer._

Window properties can be added using the `Winprops` tab of the PaperWM extension settings:

https://user-images.githubusercontent.com/30424662/211422647-79e64d56-5dbb-4054-b9a6-32bf3194b636.mp4

The `wm_class` or `title` of a window can be found by using looking glass: AltF2 `lg` Return 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).

### 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.

You do this by using the special "match all" operator `*` as an input for `wm_class` or `title`. The below image shows setting a default `Preferred width` value of `50%`.

Setting default window property rule

This special operator is at a lower precedence, so more specific properties that match a window will always take precedence and be applied.

## Window insertion position for new windows

By default PaperWM inserts new windows to the right of the currently active window. This behaviour can be changed via PaperWM settings, or with the `Open Window Position` button/icon (which is to the right of the focus mode icon):

![Open positions button](media/open-position-button.png)

There are several `positions` available for selection. Namely, `right`, `left`, `start`, `end`. The latter two will insert windows at the start or end of tiled windows container.

Options for these settings, as well as settings to enable/disable specific positions in the `Open Window Position` buttons, are provided in PaperWM settings:

https://github.com/paperwm/PaperWM/assets/30424662/4e4aa415-d047-44cb-b87a-d7e08493ecbd

## Managing multiple windows at once

PaperWM provides functionality to move, reorder, and close multiple windows at once. These "multi-window" operations are initialised with the `Take the window, dropping it when finished navigating` keybind (default SuperT).

This allows you to `take` multiple windows and temporarily store them in the bottom-right corner of the workspace. The following operations are available while there are one or more windows "taken":

_Selectively take/drop windows (pressing `spacebar` to drop the latest taken window):_

https://github.com/paperwm/PaperWM/assets/30424662/f736adea-d5ba-4c9d-aca0-2f63322c08cb

_Selecting all windows across spaces to close at once (pressing `q`):_

https://github.com/paperwm/PaperWM/assets/30424662/e6596de2-f5f7-46af-b447-044f17f326f9

_Reordring "taken" windows and selectively dropping them:_

https://github.com/paperwm/PaperWM/assets/30424662/c7c50471-f352-4693-a936-2e711189f933

## User configuration & development ##

You can 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).

You can reload the `user.css` by disabling (turning off) PaperWM and then re-enabling PaperWM (turning on), e.g via `Extensions` app, or by running `Main.loadTheme()` in looking glass (i.e. AltF2 `lg` Return). Note that the latter approach will reload all other .css files (e.g. from other extensions) and `user.css` needs to already be loaded for this to work. So after initially creating the file you'll need to disable then enable PaperWM (or restart Gnome).

### Using PaperWM extension settings (UI) to modify settings
PaperWM provides an extension settings UI to modify many of PaperWM's more prevalent settings. This is available in the `gnome-extensions` application.

### Using dconf-editor to modify settings
You can also use `dconf-editor` to view and modify all PaperWM user settings. You can view all settings by executing the following command from a terminal:

```shell
GSETTINGS_SCHEMA_DIR=::$HOME/.local/share/gnome-shell/extensions/[email protected]/schemas dconf-editor /org/gnome/shell/extensions/paperwm/ &>/dev/null
```

### PaperWM user-configurable settings _not_ available in settings UI

Below is a list of user-configurable settings that are not exposed in the PaperWM settings UI. These can be modified via [`dconf-editor`](#using-dconf-editor-to-modify-settings).

Setting | Description | Input Type | Default value
--------|-------------|------------|--------------
default‑background| Sets the (default) background used for PaperWM workspaces. If set will use this background instead of colors defined in `workspace-colors`. | _absolute path_ | _empty_

_Note: you can override this for individual workspaces in the settings UI._

__Example:__
```
dconf write /org/gnome/shell/extensions/paperwm/default-background '"/home/user/Wallpaper/mars-sunset-2k.jpg"'
```

Setting | Description | Input Type | Default value
--------|-------------|------------|--------------
workspace‑colors | Sets the workspace background color palette. | _String array of colors_ | `['#314E6C', '#565248', '#445632', '#663822', '#494066', '#826647', '#4B6983', '#807D74', '#5D7555', '#884631', '#625B81', '#B39169', '#7590AE', '#BAB5AB', '#83A67F', '#C1665A', '#887FA3', '#E0C39E']`

## Gnome Top Bar opacity / styling ##

PaperWM by default changes the opacity of the Gnome Top Bar. This styling is used for certain PaperWM features. However, this styling may conflict with the Top Bar styling of other extensions (that you may prefer have style the Top Bar instead).

Users can disable PaperWM's ability to change GNOME Top Bar styling from PaperWM settings:

Enable Top Bar Styling

_Note: several PaperWM specific features are dependent on changing the Gnome Top Bar to function correctly. If you choose to disable PaperWM's ability to change the Top Bar styles (with the setting above), you may also want to disable the [Window Position Bar](#window-position-bar-colored-bar-segment-in-top-bar)_.

## Managed Gnome Shell Settings ##

There's a few Gnome Shell settings that are incompatible with, or work poorly with, PaperWM. Namely
- `workspaces-only-on-primary`: Multi monitor support require workspaces
spanning all monitors
- `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 when PaperWM is disabled.

## Recommended extensions ##

These extensions are good complements to PaperWM:

- [Switcher](https://github.com/daniellandau/switcher) - combined window switcher and launcher
- [Dash to Dock](https://micheleg.github.io/dash-to-dock/) - a great dock

## Incompatible extensions

In most cases it should be enough to disable these extensions.

- [DING (Desktop Icons NG)](https://gitlab.com/rastersoft/desktop-icons-ng) (shipped by default with Ubuntu) or similar extensions that add desktop icons. Creates invisible windows and does not properly show icons. See #784, #266
- Fedoras builtin desktop watermark (shipped with Fedora) See #706
- [Rounded Window Corners](https://github.com/yilozt/rounded-window-corners) or similar extensions that change the window shape. See #763, #431
- [Space Bar](https://github.com/christopher-l/space-bar) or similar extensions that modify workspace names etc. See #720
- [Dash to Panel](https://github.com/home-sweet-gnome/dash-to-panel) or similar panels. Works in some configurations and in some not. Is incompatible with PaperWMs window position bar. See #170, #199, #646, #382, #166, #258

See issues tagged with the [extension-conflict](https://github.com/paperwm/PaperWM/issues?q=is%3Aissue+label%3Aextension-conflict+sort%3Aupdated-desc) label for current and closed issues related to extension conflicts.

In general extensions that do one of the following are problematic when used together with PaperWM (although they might partially work):

- Modify the desktop
- Modify window "shapes" (e.g. rounded corners)
- Modify workspaces
- Modify touch gestures

PaperWM will attempt to disable keybindings of some known extensions if they clash. E.g. the Ubuntu Tiling Assistant from Ubuntu 23.10.

## Related / similar projects ##

More projects are embracing the scrollable tiling concept! The following projects may be of interest to others (especially if PaperWM doesn't quite work for you):

- Niri: https://github.com/YaLTeR/niri
- Karousel (for KDE): https://github.com/peterfajdiga/karousel
- papersway (for i3/sway): https://spwhitton.name/tech/code/papersway/

A similar idea was apparently tried out a while back: [10/GUI](https://web.archive.org/web/20201123162403/http://10gui.com/).