Coder Social home page Coder Social logo

pygrid's Introduction

PyGrid

PyGrid is a small utility which allows you to easily organize your open windows by tiling, resizing and positioning them to make the best use of your desktop real estate. It's easy to configure and supports multiple monitors.

Requirements

  • Python3
  • X11-based desktop
  • python3-gi
  • python3-xlib

Shortcuts

  • ALT+CTRL+NUMPAD-1 - Move window to bottom left.
  • ALT+CTRL+NUMPAD-2 - Move window to bottom.
  • ALT+CTRL+NUMPAD-3 - Move window to bottom right.
  • ALT+CTRL+NUMPAD-4 - Move window to left.
  • ALT+CTRL+NUMPAD-5 - Move window to center.
  • ALT+CTRL+NUMPAD-6 - Move window to right.
  • ALT+CTRL+NUMPAD-7 - Move window to top left.
  • ALT+CTRL+NUMPAD-8 - Move window to top.
  • ALT+CTRL+NUMPAD-9 - Move window to top right.

Repeatedly press one of the defined keybindings to cycle through window sizes available at the desired location on the screen.

Configuration

Configuration is done via a JSON file located at ~/.config/pygrid.json which will be created with default options if not found when starting up. The default configuration is below. If you introduce top level sections 'monitor0': {...} or 'monitor1': {...} to provide different options for each monitor on your system. Any settings not defined will fall back to user-defined defaults, then global defaults. NOTE: Updating configuration in this JSON file does not require you to restart PyGrid.

{
  'default': {
    'xdivs': 3,               // number of x divisions for the screen.
    'ydivs': 2,               // number of y divisions for the screen.
    'padding': [0, 0, 0, 0],  // additional top, right, bottom, left padding in pixels.
    'spacing': 4,             // spacing between windows in pixels.
    'minwidth': 0.25,         // min percent width of window.
    'maxwidth': 0.67,         // max percent width of window.
    'minheight': 0.33,        // min percent height of window.
    'maxheight': 0.67,        // max percent height of window.
  },
  'monitor0': { ... },        // Repeat any settings above specific for monitor 0.
  'monitor1': { ... },        // Repeat any settings above specific for monitor 1.
  'monitor<NUM>': { ... },    // Repeat any settings above specific for monitor <NUM>.
}

Installation on Ubuntu

$ sudo apt-get install git python3-gi python3-xlib
$ cd <place-you-want-to-store-pygrid>
$ git clone https://github.com/mjs7231/pygrid.git
$ cd pygrid && ./pygrid.py

To start at boot I simply added the following line to Startup Applications.

/usr/bin/python3 <full-path>/pygrid/pygrid.py

Credit & License

PyGrid was original a fork of QuickTile by ssokolow, but rewritten to allow a much easier configuration as well as updated code to run on Python3 & GTK3. Code released under GPLv2 License.

pygrid's People

Contributors

pkkid avatar

Watchers

James Cloos avatar Hovis avatar

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.