Conventions

Note This is additional information
Note This is a tip
Note This is an example configuration or setting

 

 

What is Wingrid?

It is a convenient and speedy way to place the active window into a predetermined position and size on screen.

When working with multiple open windows, you often need to drag them around the desktop to put them into optimal locations. Wingrid can help by automating the relocation.

The screen is notionally divided into 4 equally sized invisible rectangles in a 2x2 grid. Via a key press, the active window is moved within the grid. Each window may occupy any 1, any 2 adjacent, or all 4 rectangles. You can choose whether the window is to be at the top, bottom, left, or right of the screen, or maximized. You can also change the position and size of any window at any time.

This flexibility enables you to put multiple windows into a layout that suits your way of working. It is easy to have one layout for your current task and a different one when you switch to your next task.

 

 

Placing a Window into the Grid

The window to be acted upon is always the active window. It is sometimes known as the window that has the focus.

Placing the window into the grid is done by a combined key press, i.e. the control key (Ctrl) and a number key (1-9).
Each number key represents a different placement within the grid as shown in the following diagram.

wingrid/ctrl1-9.jpg

 

Various permutations can be created to suit your preferred layout, for example

wingrid/ctrl-permutations.jpg

 

Tip If your vertically stacked windows overlap,
refer to the section named Fine Tuning

 

You may also gracefully close a window

wingrid/ctrl0.jpg

 

 

Fine Tuning

You can control Wingrid by changing its settings.

Note Settings are held in a single hidden file in your home folder
.config/wingrid/wingrid.conf

In any layout in which windows are stacked vertically, they might be slightly misaligned and produce overlap. This can be corrected by increasing/reducing the height of the windows in wingrid.conf. Adjustments are usually set-and-forget. Once they have been done to your satisfaction, they will work for all window layouts that Wingrid stacks vertically.

Tip A simple way to open wingrid.conf for editing is
1. Switch your file manager to show hidden files
2. Browse to .config/wingrid/wingrid.conf
3. Select the file and open it in your text editor

Correcting Overlapping Windows

The method uses two windows stacked vertically via Ctrl3 and Ctrl4 respectively.
In wingrid.conf

  1. Change WINHEIGHT_LESS from zero to a value of your choice

  2. Save the change

  3. Click on the top window in the stack to make it active

  4. Press Ctrl3 to refresh the window
    The bottom edge of the top window has moved up the screen

  5. Change WINHEIGHT_MORE from zero to a value of your choice

  6. Save the change

  7. Click on the bottom window in the stack to make it active

  8. Press Ctrl4 to refresh the window
    The top edge of the bottom window has moved up the screen

Repeat the adjustment process using refined values if neccessary until the windows abut correctly.

 

Example Adjustment of Window Heights

On the author’s system the following creates top and bottom windows of equal height

Note

wingrid.conf

# All adjustment values below are pixels

# Reduce Window Height
# The top edge of the window remains unchanged
# The bottom edge of the window moves towards the top edge
# Applies when putting a window in the following grid positions
#   Bottom
#   Bottom Left
#   Bottom Right
#   Top
#   Top Left
#   Top Right
# Default: WINHEIGHT_LESS=0
WINHEIGHT_LESS=35


# Increase Window Height
# The bottom edge of the window remains unchanged
# The top edge of the window moves away from the bottom edge
# Applies when putting a window in the following grid positions
#   Bottom
#   Bottom Left
#   Bottom Right
# Default: WINHEIGHT_MORE=0
WINHEIGHT_MORE=10


# Increase Gap from Top Edge of Screen to Top Edge of Top Window
# The window dimensions remain unchanged
# The entire window moves vertically down the screen
# Applies when putting a window in the following grid positions
#   Top
#   Top Left
#   Top Right
# Default: GAPTOP=0
GAPTOP=0


# Increase Gap from Left Edge of Screen to Left Edge of Left Window
# The window dimensions remain unchanged
# The entire window moves horizontally across the screen
# Applies when putting a window in the following grid positions
#   Left
#   Left Top
#   Left Bottom
# Default: GAPLEFT=0
GAPLEFT=0

 

 

Changing the Key Combinations

The assignment of a combined keypress is handled by the window manager. In your antiX system this will often be one of the following Fluxbox, IceWM, or JWM.

Note Key assignments are held in a hidden file in your home folder
.fluxbox/keys
.icewm/keys
.jwm/keys

Each of them assigns combined keystrokes in its own way. Changing assignments is best done after referring to the user manual of the your chosen window manager.

 

 

Summary of Files

Configuration file is located in /home/USERNAME/.config/wingrid/

  • wingrid.conf is the default configuration file

Executable files are located in /usr/local/bin/

  • wingrid-left.sh

  • wingrid-right.sh

  • wingrid-top.sh

  • wingrid-bottom.sh

  • wingrid-topleft.sh

  • wingrid-topright.sh

  • wingrid-bottomleft.sh

  • wingrid-bottomright.sh

  • wingrid-maximize.sh

  • wingrid-close.sh

Video

Quick look at wingrid by runwiththedolphin https://www.youtube.com/watch?v=JRO-meyYGWg#t=14m19s