Giter Club home page Giter Club logo

window_grid's Introduction

window_grid

The window_grid script provides tiling-like window-placement capabilities for any window-manager. It is ideal for mapping to particular key-strokes to resize / reposition windows on demand.

Window-grid demo

This script positions any X11 window based on a grid. The grid is subdivided, by default, into 8 segments in each direction. (This can be overridden using the -d flag.)

This script requires the following tools to be installed: xprop wmctrl xdotool and xrandr.

Examples:

# make active window take up top-left quadrant
window_grid -w 4 -h 4 -x 0 -y 0

# place active window in bottom-right quadrant
window_grid -w 4 -h 4 -x 4 -y 4

# place active window on left-half of screen
window_grid -w 4 -h 8 -x 0 -y 0

# place active window at center of screen, with 
# one grid-space of space between window and 
# edge of screen
window_grid -w 6 -h 6 -x 1 -y 1

# Expand active window's width by one grid-space
window_grid -w +1

# Move window to second monitor at top-left
window_grid -s 1 -x 0 -y 0

# snap active window fit into the closest grid
# spaces based on its current size and position
window_grid -c both

Position and size are specified in grid-units and can be relative. for example, the options -x 1 -y 1 will place the top-left of the window 1 grid unit down, and 1 grid-unit right of the top-left of the screen. You can also use -x +1 or -x -1 to move the window one grid unit to the right or left respectively.

Height and width are specified the same way and can also be relative so if you specify -w +1, the window will be made one grid-unit larger than it currently is. The minimum size of a window is 1 grid-unit in each-direction. The maximum is the size of the entire screen.

This script works on the active window by default. You can operate on any window instead by providing its window-id using the -i flag.

Note that the actual pixel-size of a grid segment will depend on the your screen size. For example, for a 1920x1080 display, the default size of a 1x1 grid segment is 240 x 135.

Multiple Monitors

window_grid is multi-display aware and divides each monitor according to the resolution of that monitor. It can place windows on multiple screens, and works as you would expect in most 'normal' multi-monitor setups.

By default, all positions and sizes are considered relative to the monitor the window is currently on. You can switch the destination monitor by using the -s flag. Screens start at 0 and are enumerated in the order they are returned by xrandr.

window_grid's People

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.