Skip to main content

A Linux window management tool inspired by Microsoft's FancyZones

Project description

PyXZones

A slice of FancyZones on Linux

This project is an attempt to emulate some of the functionality Windows users are able to leverage from FancyZones. Users can drag and drop windows into predefined zones, and have PyXZones fit the window to the zone space.

How to use

Installed locally via pip (ie. pip install pyxzones) or executed as a python module from a clone of the git repository (python -m pyxzones) are effectively equivalent.

The default zone configuration and various other settings are provided the settings.py file and can be overwritten from a pyxzones.json configuration file located at the XDG_CONFIG* locations, or the user's home folder (a .pyxzones.json file is also suitable in the home folder).

Zones can be set as vertical or horizontal slices of a monitor. The existing example is hopefully suitable as guidance for general usage (please see example_config/pyxzones.json).

With zones configured, and pyxzones running, the activation key(s) also set in settings (efault Alt_L) can be held while moving a window with the cursor to activate snapping. Holding this keybinding, windows can be dragged to a zone, and upon releasing the mouse click, the window will snap to the dimensions of the predefined zone.

Note: This package requires access with the Xorg server bindings, so it should only be used on Xorg-based Unix Systems or systems with sufficient Xorg backwards compatibility. Please see more information in the below System Requirements section.

Seeing stubborn windows?

You may run across some windows that behave strangely. Specifically calling out here GTK3.0 windows, which have a default margin around them and will not cooperate with resizing to fill a zone completely.

To get around this GTK quirk, you may adjust your user CSS rules (located at ~/.config/gtk-3.0/gtk.css) for GTK as follows:

/* early GTK 3 rules */
.window-frame {
  margin: 0px;
  box-shadow: none;
}

/* newer GTK 3 rules */
window > decoration {
  margin: 0;
  box-shadow: none;
}

Note that you may need to create the file mentioned above and this will likely require an X server restart (not just log out/log in) to apply.

System Requirements

Building

To build the app, a system must have the required GTK libraries used in the current zone display window. On the development system used, these included libcairo2-dev libgirepository1.0-dev gir1.2-gtk-4.0. A reference for multiple systems is located at the PyGObject documentation located here.

Window Manager

In addition, the X Window Manager being used must support the Xrandr and Record extentions and the following X features are required for basic expected functionality:

  • _NET_WORKAREAS
  • _NET_MOVERESIZE_WINDOW
  • _NET_SHOWING_DESKTOP
  • _NET_ACTIVE_WINDOW

The features below may not be strictly required, but will degrate the quality of the experience that can be expected:

  • _NET_FRAME_EXTENTS
  • GTK_WORKAREAS*
  • _NET_WM_STATE
  • _NET_CURRENT_DESKTOP

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxzones-0.0.1.tar.gz (29.2 kB view hashes)

Uploaded Source

Built Distribution

pyxzones-0.0.1-py3-none-any.whl (30.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page