$ show domferr/tilingshell
Tiling Shell is a GNOME Shell extension that provides advanced, customizable window tiling and management. It replaces the default window snapping with a flexible layout system where users can define custom tile arrangements (via a built-in editor or JSON files), use snap assist for precise placement, enable edge tiling with multiple modes (default, adaptive, granular), and auto-tile new windows. The extension also adds a panel indicator, keyboard shortcuts, window border customization with dynamic corner radius detection, and a window suggestions feature that proposes layouts after tiling. The architecture follows a manager pattern: per-monitor subsystems (TilingManager, ResizeManager, WindowBorderManager, RaiseTogetherManager) are created and destroyed by the main extension lifecycle. Communication is event-driven via GObject signals, with a central GlobalState singleton and a Settings wrapper around GSettings. The codebase is written in TypeScript, compiled for GJS, and supports GNOME Shell versions 42–50 on both X11 and Wayland. It includes a complex build pipeline that produces separate outputs for modern and legacy GNOME versions, along with full internationalization (10+ languages). While the extension is actively maintained and feature-rich, it relies heavily on private GNOME Shell APIs and contains version-specific workarounds, which introduces maintenance risk as the shell evolves.
The LLM identified 7 files worth highlighting for reuse:
Provides a `SignalHandling` class that wraps GObject signal connections, allowing bulk connect/disconnect. This pattern is essential for preventing memory leaks in GJS extensions and can be extracted for any GObject-based project. It demonstrates clean encapsulation of a common GJS pattern.
A generic base class for rendering layouts of tiles. Subclasses provide `buildTile()` to create visual tile representations. This template method pattern is reusable for any grid-based UI and is decoupled from the specific tile preview implementation. It shows good separation of concerns.
Base class for all visual tile previews (open/close animations, border radius, gaps). It handles common rendering logic and can be reused in other tiling or grid-based extensions. The animation state machine is well-structured.
Singleton wrapper around Gio.Settings that provides static getters/setters for all extension keys, plus two-way binding and version migration. This pattern is reusable for any GSettings-backed extension and demonstrates proper encapsulation of configuration logic.
`TouchPointer` class unifies mouse and touch input for drag operations. It abstracts away the differences between pointer and touch events, making it reusable for any GJS UI that needs drag support. The implementation is clean and self-contained.
Implements a D-Bus interface (`org.gnome.Shell.Extensions.TilingShell`) to expose the layout editor opening functionality. This pattern is reusable for any GNOME Shell extension that needs to expose an IPC endpoint. The code is minimal and follows GJS D-Bus conventions.
A proxy class that groups multiple Meta.Windows and delegates method calls to all of them. This is a clean implementation of the Proxy pattern for window operations and can be reused in any extension that needs to batch window actions.