Skip to content

Intelligent window management for GNOME Shell - Automatically organizes maximized and fullscreen windows into separate workspaces for a cleaner workflow

License

Notifications You must be signed in to change notification settings

DilZhaan/ScreenToSpace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ScreenToSpace

Intelligent Window Management for GNOME Shell 49+

A GNOME Shell extension that automatically organizes your workspace by moving maximized and fullscreen windows to empty workspaces. Keep your workflow clean and organized with intelligent multi-monitor support.

License: GPL v2 GNOME Shell


✨ Features

  • πŸ–₯️ Automatic Workspace Management: Maximized and fullscreen windows automatically move to empty workspaces
  • 🎯 Smart Window Placement: Intelligently reorders workspaces to maintain workflow continuity
  • πŸ–ΌοΈ Multi-Monitor Support: Works seamlessly across multiple displays
  • βš™οΈ Configurable Behavior: Choose whether to move maximized windows, fullscreen windows, or both
  • πŸ”„ Dynamic Workspace Handling: Automatically manages workspace creation and cleanup
  • 🌐 Internationalization Ready: Built-in i18n support for multiple languages

πŸ“‹ Requirements

  • GNOME Shell: Version 49 or higher
  • Operating System: Linux with GNOME desktop environment
  • Dependencies: Standard GNOME Shell extensions dependencies

πŸš€ Installation

Method 1: Manual Installation (Recommended for Development)

  1. Clone the repository:

    git clone https://github.com/DilZhaan/ScreenToSpace.git
    cd ScreenToSpace
  2. Deploy the extension:

    chmod +x scripts/deploy.sh
    ./scripts/deploy.sh
  3. Restart GNOME Shell:

    • On X11: Press Alt + F2, type r, and press Enter
    • On Wayland: Log out and log back in
  4. Enable the extension:

    gnome-extensions enable screentospace@dilzhan.dev

Method 2: Build and Install from ZIP

  1. Build the extension:

    chmod +x scripts/makezip.sh
    ./scripts/makezip.sh
  2. Install the ZIP file:

    gnome-extensions install build/screentospace@dilzhan.dev.zip
  3. Enable the extension:

    gnome-extensions enable screentospace@dilzhan.dev

βš™οΈ Configuration

Access the extension preferences through:

  • GNOME Extensions app β†’ ScreenToSpace β†’ Settings
  • Command line: gnome-extensions prefs screentospace@dilzhan.dev

Available Settings

Setting Description Default
Move Window When Maximized Automatically move maximized windows to empty workspaces. When enabled, both maximized and fullscreen windows are moved. When disabled, only fullscreen windows are moved. βœ… Enabled

🎯 How It Works

Window Placement Strategy

  1. New Maximized/Fullscreen Window:

    • Extension detects a window entering fullscreen or maximized state
    • Finds the first available empty workspace on the same monitor
    • Intelligently reorders workspaces to place the window without disrupting workflow
    • Other windows remain in their original positions
  2. Window Restore:

    • When a window is un-maximized or exits fullscreen
    • If the workspace becomes empty, it's automatically reorganized
    • Window returns to the last occupied workspace on the same monitor

Multi-Monitor Behavior

  • Workspaces Only on Primary: Only the primary monitor has multiple workspaces; extension works exclusively on the primary display
  • Workspaces on All Monitors: Extension manages workspaces independently for each monitor

πŸ—οΈ Architecture

This extension is built following SOLID principles with a modular, maintainable architecture:

src/
β”œβ”€β”€ extension.js           # Main extension entry point
β”œβ”€β”€ constants.js          # Centralized constants and strings (i18n ready)
β”œβ”€β”€ eventHandler.js       # Window manager event handling (SRP)
β”œβ”€β”€ windowFilter.js       # Window eligibility filtering (SRP)
β”œβ”€β”€ windowPlacement.js    # Window placement logic (SRP)
β”œβ”€β”€ workspaceManager.js   # Workspace operations (SRP)
β”œβ”€β”€ i18n.js              # Internationalization utilities
β”œβ”€β”€ prefs.js             # Preferences UI
└── schemas/             # GSettings schemas
    └── org.gnome.shell.extensions.screentospace.gschema.xml

Key Design Principles

  • Single Responsibility Principle: Each module handles one specific concern
  • Open/Closed Principle: Extensible without modifying core logic
  • Dependency Inversion: High-level modules don't depend on low-level details
  • Interface Segregation: Clean, focused interfaces for each component
  • DRY (Don't Repeat Yourself): No code duplication, centralized logic

πŸ› Troubleshooting

Extension Not Loading

# Check extension status
gnome-extensions info screentospace@dilzhan.dev

# View GNOME Shell logs
journalctl -f -o cat /usr/bin/gnome-shell

# Reset extension settings
dconf reset -f /org/gnome/shell/extensions/screentospace/

Schema Issues

If you encounter schema-related errors:

# Recompile schemas
glib-compile-schemas src/schemas/

# Or use the deploy script which handles this automatically
./scripts/deploy.sh

Common Issues

  1. Extension not visible in Extensions app:

    • Ensure GNOME Shell version is 49+: gnome-shell --version
    • Check if extension is installed: gnome-extensions list
  2. Windows not moving automatically:

    • Verify extension is enabled: gnome-extensions info screentospace@dilzhan.dev
    • Check settings: gnome-extensions prefs screentospace@dilzhan.dev
    • Ensure dynamic workspaces are enabled in GNOME settings
  3. Multi-monitor issues:

    • Check "Workspaces on primary display only" setting in GNOME Tweaks
    • Extension behavior adapts based on this system setting

πŸ”§ Development

Prerequisites for Development

# Install development dependencies
sudo apt-get install gettext glib-2.0-dev

# For Fedora/RHEL
sudo dnf install gettext glib2-devel

Project Structure

ScreenToSpace/
β”œβ”€β”€ src/              # Source code
β”œβ”€β”€ po/               # Translations
β”œβ”€β”€ scripts/          # Build and deployment scripts
β”œβ”€β”€ build/            # Build output (generated)
β”œβ”€β”€ LICENSE           # GPL-2.0 license
└── README.md         # This file

Building from Source

# Build extension package
./scripts/makezip.sh

# Output: build/screentospace@dilzhan.dev.zip

Testing Changes

# Deploy to local extensions directory
./scripts/deploy.sh

# Restart GNOME Shell (X11)
Alt + F2, type 'r', press Enter

# Watch logs for debugging
journalctl -f -o cat /usr/bin/gnome-shell | grep screentospace

Code Style

  • ES6+ JavaScript
  • 4-space indentation
  • Descriptive variable and function names
  • JSDoc comments for public APIs
  • Follow GNOME JavaScript style guidelines

πŸ“ License

This project is licensed under the GNU General Public License v2.0 or later - see the LICENSE file for details.

Copyright (C) 2025 DilZhaan

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

πŸ‘€ Author

DilZhaan


πŸ™ Acknowledgments

This extension was developed from scratch following modern software engineering principles and GNOME Shell extension best practices.


πŸ“Š Project Status

Status: Active Development
Version: 1
GNOME Shell Compatibility: 49+


πŸ—ΊοΈ Roadmap

  • Add more workspace placement strategies
  • Implement custom keyboard shortcuts
  • Add workspace naming and organization features
  • Create comprehensive test suite
  • Add more language translations
  • Integration with GNOME Activities overview

πŸ’¬ Support

If you encounter any issues or have questions:

  1. Check the Troubleshooting section
  2. Review existing issues
  3. Create a new issue with detailed information

Made with ❀️ by DilZhaan

About

Intelligent window management for GNOME Shell - Automatically organizes maximized and fullscreen windows into separate workspaces for a cleaner workflow

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published