Coder Social home page Coder Social logo

shell's Introduction

Pop Shell

Pop Shell is a keyboard-driven layer for GNOME Shell which allows for quick and sensible navigation and management of windows. The core feature of Pop Shell is the addition of advanced tiling window management — a feature that has been highly sought within our community. For many — ourselves included — i3wm has become the leading competitor to the GNOME desktop.

Tiling window management in GNOME is virtually nonexistent, which makes the desktop awkward to interact with when your needs exceed that of two windows at a given time. Luckily, GNOME Shell is an extensible desktop with the foundations that make it possible to implement a tiling window manager on top of the desktop.

Therefore, we see an opportunity here to advance the usability of the GNOME desktop to better accommodate the needs of our community with Pop Shell. Advanced tiling window management is a must for the desktop, so we've merged i3-like tiling window management with the GNOME desktop for the best of both worlds.


Table of Contents


The Proposal

A proposal for integration of the tiling window management features from Pop Shell into GNOME is currently under development. It will be created as a GitLab issue on GNOME Shell for future discussion, once we have invested our time into producing a functioning prototype, and learned what does and does not work in practice.

Ideally, the features explored in Pop Shell will be available for any environment using Mutter — far extending the half-monitor tiling capability currently present. By starting out as a shell extension, anyone using GNOME Shell can install this onto their system, without having to install a Pop-specific fork of GNOME on their system.


The Problem

So, why is this a problem for us, and why do so many of our users switch to i3wm?

Displays are large, and windows are many

GNOME currently only supports half-tiling, which tiles one window to one side of the screen, and another window to the other side of the screen. If you have more than two windows, it is expected to place them on separate workspaces, monitors, or to alternate between windows with Alt + Tab.

This tends to work fine if you only have a small handful of applications. If you need more than two windows at a time on a display, your only option is to manually drag windows into position, and resize them to fit alongside each other — a very time-consuming process that could easily be automated and streamlined.

Displays are large. Very, very large

Suppose you are a lucky — or perhaps unlucky — owner of an ultra-wide display. A maximized window will have much of its preferences and controls dispersed across the far left and far right corners. The application may place a panel with buttons on the far left, while other buttons get shifted to either the distant center or far right.

Half-tiling in this scenario means that each window will be as large as an entire 2560x1440 or 4K display. In either scenario, at such extreme sizes, the mouse becomes completely useless — and applications become unbearable to use — in practice.

Fighting the window manager is futile

As you struggle with fighting the window manager, it quickly becomes clear that any attempt to manage windows in a traditional stacking manner — where you need to manually move windows into place, and then manually resize them — is futile. Humans are nowhere near as precise or as quick as algorithms at aligning windows alongside each other on a display.

Why not switch to i3wm?

The GNOME desktop comes with many useful desktop integration features, which are lost when switching to an i3wm session. Although possible to connect various GNOME session services to an i3wm session, much of the GNOME desktop experience is still lost in the process. The application overview, the GNOME panel, and GNOME extensions.

Even worse, many users are completely unfamiliar with tiling window managers, and may never feel comfortable switching "cold turkey" to one. By offering tiling window management as a feature that can be opted into, we can empower the user to ease into gaining greater control over their desktop, so that the idea of tiling window management suddenly becomes accessible.

There are additionally those who do want the traditional stacking window management experience, but they also want to be able to opt into advanced tiling window management, too. So it should be possible to opt into tiling window management as necessary. Other operating systems have successfully combined tiling window management features with the traditional stacking window management experience, and we feel that we can do this with GNOME as well.


Installation

To install this GNOME Shell extension, you MUST have the following:

  • GNOME Shell 3.36
  • TypeScript 3.8
  • GNU Make

Proper functionality of the shell requires modifying GNOME's default keyboard shortcuts. For a local installation, run make local-install.

The master_mantic git branch corresponds to Ubuntu 23.10 and supports GNOME 45+. For GNOME 3.36 through 44 support, use the master_jammy branch.

If you want to uninstall the extension, you may invoke make uninstall, and then open the "Keyboard Shortcuts" panel in GNOME Settings to select the "Reset All.." button in the header bar.

Note that if you are packaging for your Linux distribution, many features in Pop Shell will not work out of the box because they require changes to GNOME's default keyboard shortcuts. A local install is necessary if you aren't packaging your GNOME session with these default keyboard shortcuts unset or changed.

Packaging status

  • Fedora: sudo dnf install gnome-shell-extension-pop-shell xprop
  • Gentoo: emerge gnome-shell-extension-pop-shell
  • openSUSE Tumbleweed: sudo zypper install gnome-shell-extension-pop-shell
  • Arch Linux (Using Yay as AUR helper):
    • yay -S gnome-shell-extension-pop-shell
    • For precompiled binary version: yay -S gnome-shell-extension-pop-shell-bin
    • For GitHub repository version: yay -S gnome-shell-extension-pop-shell-git

Shared Features

Features that are shared between stacking and auto-tiling modes.

Directional Keys

These are key to many of the shortcuts utilized by tiling window managers. This document will henceforth refer to these keys as <Direction>, which default to the following keys:

  • Left or h
  • Down or j
  • Up or k
  • Right or l

Overridden GNOME Shortcuts

  • Super + q: Close window
  • Super + m: Maximize the focused window
  • Super + ,: Minimize the focused window
  • Super + Esc: Lock screen
  • Super + f: Files
  • Super + e: Email
  • Super + b: Web Browser
  • Super + t: Terminal

Window Management Mode

This mode is activated with Super + Return.

Window management mode activates additional keyboard control over the size and location of the currently-focused window. The behavior of this mode changes slightly based on whether you are in auto-tile mode, or in the default stacking mode. In the default mode, an overlay is displayed snapped to a grid, which represents a possible future location and size of your focused window. This behavior changes slightly in auto-tiling mode, where resizes are performed immediately and overlays are only shown when swapping windows.

Activating this enables the following behaviors:

  • <Direction>
    • In default mode, this will move the displayed overlay around based on a grid
    • In auto-tile mode, this will resize the window
  • Shift + <Direction>
    • In default mode, this will resize the overlay
    • In auto-tile mode, this will do nothing
  • Ctrl + <Direction>
    • Selects a window in the given direction of the overlay
    • When Return is pressed, window positions will be swapped
  • Shift + Ctrl + <Direction>
    • In auto-tile mode, this resizes in the opposite direction
  • O: Toggles between horizontal and vertical tiling in auto-tile mode
  • ~: Toggles between floating and tiling in auto-tile mode
  • Return: Applies the changes that have been requested
  • Esc: Cancels any changes that were requested

Window Focus Switching

When not in window management mode, pressing Super + <Direction> will shift window focus to a window in the given direction. This is calculated based on the distance between the center of the side of the focused window that the window is being shifted from, and the opposite side of windows surrounding it.

Switching focus to the left will calculate from the center of the east side of the focused window to the center of the west side of all other windows. The window with the least distance is the window we pick.

Launcher

Pop Shell provides an integrated launcher which interfaces directly with our pop-launcher service. JSON IPC is used to communicate between the shell and the launcher in an asynchronous fashion. This functionality was separated from the shell due to performance and maintainability issues. The new launcher is written in Rust and fully async. The launcher has extensive features that would be useful for implementing desktop launchers beyond a shell extension.

Inner and Outer Gaps

Gaps improve the aesthetics of tiled windows and make it easier to grab the edge of a specific window. We've decided to add support for inner and outer gaps, and made these settings configurable in the extension's popup menu.

Hiding Window Title Bars

Windows with server-side decorations may have their title bars completely hidden, resulting in additional screen real estate for your applications, and a visually cleaner environment. This feature can be toggled in the extension's popup menu. Windows can be moved with the mouse by holding Super when clicking and dragging a window to another location, or using the keyboard shortcuts native to pop-shell. Windows may be closed by pressing Super + Q, and maximized with Super + M.


Floating Mode

This is the default mode of Pop Shell, which combines traditional stacking window management, with optional tiling window management features.

Display Grid

In this mode, displays are split into a grid of columns and rows. When entering tile mode, windows are snapped to this grid as they are placed. The number of rows and columns are configurable in the extension's popup menu in the panel.

Snap-to-Grid

An optional feature to improve your tiling experience is the ability to snap windows to the grid when using your mouse to move and resize them. This provides the same precision as entering window management mode to position a window with your keyboard, but with the convenience and familiarity of a mouse. This feature can be enabled through the extension's popup menu.


Tiling Mode

Disabled by default, this mode manages windows using a tree-based tiling window manager. Similar to i3, each node of the tree represents two branches. A branch may be a window, a fork containing more branches, or a stack that contains many windows. Each branch represents a rectangular area of space on the screen, and can be subdivided by creating more branches inside of a branch. As windows are created, they are assigned to the window or stack that is actively focused, which creates a new fork on a window, or attaches the window to the focused stack. As windows are destroyed, the opposite is performed to compress the tree and rearrange windows to their new dimensions.

Keyboard Shortcuts

Customizing the Floating Window List

There is file $XDG_CONFIG_HOME/pop-shell/config.json where you can add the following structure:

{
  class: "<WM_CLASS String from xprop>",
  title: "<Optional Window Title>"
}

For example, doing xprop on GNOME Settings (or GNOME Control Center), the WM_CLASS values are gnome-control-center and Gnome-control-center. Use the second value (Gnome-control-center), which pop-shell will read. The title field is optional.

After applying changes in config.json, you can reload the tiling if it doesn't work the first time.

Developers

Due to the risky nature of plain JavaScript, this GNOME Shell extension is written in TypeScript. In addition to supplying static type-checking and self-documenting classes and interfaces, it allows us to write modern JavaScript syntax whilst supporting the generation of code for older targets.

Please install the following as dependencies when developing:

  • Node.js LTS+ (v12+)
  • Latest npm (comes with NodeJS)
  • npm install typescript@latest

While working on the shell, you can recompile, reconfigure, reinstall, and restart GNOME Shell with logging with make debug. Note that this only works reliably in X11 sessions, since Wayland will exit to the login screen on restarting the shell.

Discussions welcome on Pop Chat

License

Licensed under the GNU General Public License, Version 3.0, (LICENSE or https://www.gnu.org/licenses/gpl-3.0.en.html)

Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the GNU GPLv3.

shell's People

Contributors

aarivvk avatar akk9 avatar alphacluster avatar amaxine avatar bennypowers avatar bryanpaget avatar canadaduane avatar carlwgeorge avatar garaevdi avatar gloriouseggroll avatar ids1024 avatar isantop avatar jackpot51 avatar jacobgkau avatar jmmaranan avatar laurentlbm avatar maru-sama avatar mmstick avatar mooey5775 avatar n3m0-22 avatar nicolae-stroncea avatar rthery avatar scaryrawr avatar sevenautumns avatar sjmikler avatar timrichardson avatar varac avatar watchmkr avatar xanewok avatar yasserkaddour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shell's Issues

Complete Window-Title Toggle Feature

By default Brave (and other Chrome browsers) have headerbars and enabling it adds a double headerbar though it removes it for other applications.

This is on Pop 20.04 LTS which may void out this bug report which is fine.

gnome-shell --version
GNOME Shell 3.34.3

Just pulled the shell from git a few minutes ago.

Windows jumping to wrong monitor

When I'm starting with both monitors completely empty with tiling mode enabled, I can open one terminal window and it opens fullscreen as expected. However the next one I open pushes the new window and the one that was already open to my other monitor.

animation
This gif was taken across two 1080p monitors. Having Peek any larger interfered with the bug I was seeing, so I had to make it a bit smaller. Hopefully it's still clear, but basically I opened a terminal on the right monitor, and opening one one more pushed both of them over to the left monitor.

Remove Switch Monitor Ctrl+Super+Left/Right Shortcuts

After a discussion with @maria-komarova , we think we may want to reconsider overriding Ctrl+Super+Left and Right for half-tiling windows left or right on the screen. I'm not certain it will work great in tiling mode, but in the default non-tiling mode, it breaks immersion and takes far more keypresses. What used to be a single hotkey now requires me to enter window management mode, move the window, resize the window, then hit enter. The process seems likely to monopolize the user's attention span, which is detrimental for productivity.

Ctrl + Super + Up was assigned to multiple things

I know this is still early, but I discovered the cause of my biggest pain point with pop-shell so far. Somehow Ctrl + Super + Up was assigned to two actions: switch workspace up and restore window. Once I manually reset that hotkey, everything was much better. I did toggle the extension a few times, so maybe that's where the issue came from. I'm also running 20.04, in case that is relevant.

2-26 Feedback Meeting

  • Super Q for closing windows (To avoid the destructive action of closing a window when closing browser tabs (CTRL+W) was the intent)
  • Rename "Launch Windows Tiled" to "Tile Windows"
    • Change functionality to tile all open windows when activated
    • Give the largest space the browser
  • When in tiling mode Super+Enter and then direction keys moves the window to a different tree
  • When in tiling mode Super+Enter then Shift+direction keys resizes the tree
  • Add Appearance drop down to the extension with Inner Gaps, Outer Gaps, and Show Widow Titles options.
  • Adjust gap sizes as the setting is changed (rather than on enter)
  • Super + W to convert a window to floating and vice versa
  • Change toggle orientation to Super + O
  • Add application launching
    • Search via desktop files
    • Command line execution
    • sudo command handling
  • Fix resizing issues

Add gaps feature

  • Added gap settings
  • Avoid gap on top-most corner
  • Avoid gap on left-most corner
  • Avoid gap on right-most corner
  • Avoid gap on bottom-most corner
  • Gap everything in-between

Fork balancing sometimes makes Super+O reorient windows strangely

If I open a bunch of tiled windows and close a bunch on one side of the fork, I can make a whole bunch on one side of the fork reorient with the single window on the other side of the fork when I hit Super + O. Is this they way it's supposed to work, or should forks rebalance themselves so not so many windows change with an orientation change?

animation

Snap to grid leaves large gap at bottom of screen when windows are maximized

Screenshot from 2020-02-28 15-01-42

For this bug I have Snap to Grid and Show Window Titles activated.

Maximized windows result in a large empty area at the bottom of the screen, almost like the outer gap gets applied multiple times, but only at the bottom. If I hit Super+M, the gap only appears after I click the top bar, but if I drag the window to the top of the screen, the empty area appears right away. The empty area was proportionally much larger on a 4K display.

Gaps round down to powers of 4

I think this is intentional, but I can't set a gap value that isn't a multiple of 4. If the value entered isn't a multiple of 4, it sets it to the next lowest multiple of 4. This seems pretty reasonable, although I wonder if true rounding would be more user-friendly than rounding down each time. For example, if I enter 7, it sets it to 4. Would 8 be better since it's closer to the number the user entered?

Should the management overlay not match up with windows in floating mode?

Screenshot from 2020-02-28 15-27-32

If I'm in floating mode and I open the management overlay, there is a good chance a window I select won't line up with the borders of the management overlay. I know the overlay is on a grid, while windows in floating mode are not, but it does look a little strange, and hitting enter without making adjustments will slightly resize the window to the size of the overlay. I'm wondering if the first view of the overlay shouldn't be forced to line up with the window, then return to its grid once adjustments are made?

Ctrl+Super+Left tiles window to left side of screen

When launching an application with "Launch windows tiled" disabled, Ctrl+Super+Left will tile the program to the left side of the screen. Pressing it again will untile the program. Ctrl+Super+Right does not do anything.

Pixel in top-left corner

There is a bright pixel in the top-left corner when this extension is enabled and before the overlay is used.

Window focus dialog remains open on lockscreen

When the window focus dialog (Super+/) is launched, locking the screen or letting the system lock itself on powersaving timeout, does not close out of the dialog. From the locked screen I can see what applications are open but cannot interact with this menu.

Opening 4+ windows on 1080p screen does not tile as designed

With tiling on by default, on a 1080p display, the fourth window opened (without changing focus of the windows other than by opening the second and third windows) does not follow the window tiling guidelines as defined here: #9.

Screenshot of current behavior:
Screenshot from 2020-02-25 10-38-13

Screenshot of behavior defined in #9:
defaulttiling

Window focus dialog improperly themed in dark mode

With dark mode enabled, launching the window focus dialog Super+/ shows a dark text box with a white dialog around it. The white dialog makes this look very odd. This looks fine in light mode, so I think this is an issue with appropriately theming the dialog in different modes.

Window Focus dialog appears underneath tiling mode window selection

When a window is selected with Super+Enter and then Super+/ is selected, the window focus dialog is below the window highlighting from the window having focus.

Screenshot from 2020-02-25 13-10-28

I see that when launching the window focus dialog first, upon executing Super+Enter, the focus dialog closes (although a bit glitchy).

Grid leaves empty area at bottom of screen

This seems like it may be related to #39

If I use Super + Enter to resize a window while in free-float mode, there is a region on the bottom of the screen that I cannot resize the window into with Shift + arrows. I can use the mouse to expand the window into that area, but it's almost like the grid does not extend that far.

Screenshot from 2020-03-02 09-34-37

The screenshot above shows my monitor setup with an Alacritty window on each display sized as large as I can make it in window management mode. The top display is 4K (100% scaling) and the bottom one is 1080p. The empty area is much larger on the 4K display in terms of pixels, but it seems roughly the same proportionally as the 1080p display.

Also this does not seem to happen with tiling mode activated, so that tiling grid seems to line up with the full area of my displays better.

Old Keyboard Shortcuts are Lost W/out warning

Context

I wanted to try this to start offering early feedback and to start getting used to what I think is going to be amazing so I asked around and @mmstick got me hooked up right away (thanks!).

I'm on Pop 19.10 and had to do npm install -g typescript (I already had npm set up).
tsc --version now returns Version 3.8.3

This is an Oryx Pro 2019.

Problem

After running the rebuild.sh script, I noticed all my mostly default familiar Pop!_OS shortcuts to move windows around no longer worked. This is obviously expected (that there will be new conflicting shortcuts with a regular Gnome Session), but what was not necessarily expected was that I was going to "lose" my original shortcuts.

Perhaps there's a way to mitigate this (warn users? allow to "save" them?)

Expected

That there was a way to restore my shortcuts the way they were before.

Why am I filing this?

At the request of "shpurk" on mattermost who said: (And I quote):

Maybe you should file an issue about this, the fact that you didn't think to do this/etc, when people upgrade to 20.04, there will probably be a lot more people in the same spot you are in.

Thanks!

Window Focus dialog window moves when typing

When Super+/ is pressed:
Screenshot from 2020-02-28 17-22-39

After typing the position of the text box on the screen moves, which can be disorienting to the user:
Screenshot from 2020-02-28 17-22-51
(note the alignment between the input box and "Online Accounts" in the window below)

I think it might be better if the text box stayed in the same place, but the dialog grew downwards to accommodate the results that appear.

Designs for default tiling, launcher, menu and a section in Settings > Desktop & Workspaces

Design for the default tiling (the logic is open to discussion).
Rules/Steps:

  1. Maximum number of tiles before the system starts splitting windows horizontally:
    • regular format - 2
    • ultrawide - 4
  2. The focus shifts to the newly opened window.
  3. Open the next window to the right from the one with the focus untill you reach the horizontal split point.
  4. When splitting windows horizontally, open the new window at the bottom.
  5. Then split the window to the left.
  6. After that, open the new window to the left of the one with focus.
    Default-Tiling(1)

Menu design that includes:
keyboard shortcuts,
gap setting,
the option to launch windows tiled,
custom layout.
All of the small designs in one window - just to show where the menu will be.
Combined

1
1-1

Step by step saving the new custom layout (Click Save Current in the menu - name the layout and click save - confirmation that the layout was saved - new layout added to the list of custom layouts).

  1. 1-2

  2. Name

  3. Confirmation

  4. 1-3

Launcher design
Launcher

Section of the Settings > Desktop & Workspaces page.
The page is part of the upcoming Gnome design: https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/590
DesktopWorkspaces

Gaps aren't applied by default

If I set a gap value then open a few windows, the windows will not have a gap between them. If I then re-apply the gap value, the windows I just opened will have gaps again. It seems like whatever applies the gaps doesn't run upon window creation.

Improvement idea: window selection indicator/animation

When changing focus to different windows on my 4K non-scaled monitor, I'm finding that it's sometimes hard to follow the mouse cursor around the screen and keep track of which window I currently have focused. If we had an animation or something to indicate which window was becoming active, I think that would make window navigation much quicker and easier.

Outer gaps can be applied multiple times

If I go to set an outer gap value of 3 but hit the enter key more than once, the outer gap gets larger with each key press. The number stays the same in the box though, so maybe something just isn't being reset properly when the outer gap value is updated.

Handle situations where a window decides to move itself

Some applications remember their location on the screen when they were last open, and then try to open themselves in the same location after they have been placed by the window manager.

Firefox is really bad about doing this after it has opened.

We should tell windows to sit and stay.

Should Window Focus dialog show currently open windows by default?

When launching the Window Focus dialog with Super+/, should the currently open windows be shown by default? Currently you have to search for something before you are shown any results at all?

I feel as though within the last week the behavior of the Window Focus dialog was to show open programs on launch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.