# DeskGrid - place windows on grid - with or without gap (beta)

**URL:** <https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503>\
**Category:** Mabox Lab\
**Created:** [May 15, 2021, 6:56pm UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503 "2021-05-15T18:56:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [May 15, 2021, 6:56pm UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/1 "2021-05-15T18:56:04Z")

</div>

This is a slightly larger project that I won’t finish in a few days, so if you have some time and feel good as a beta tester, please try it out and share your feedback.

DeskGrid is a first (of three) piece of a bigger planned feature - ability to save and restore “desktop sessions” (all windows from one virtual desktop - with their size, position and state, decorated or not).

Current state of all three pieces:

1. Deskgrid - progress: 90% - ready to some tests
2. Session manager [DeskMngr](https://forum.maboxlinux.org/t/deskmngr-save-and-restore-desktop-sessions-beta/506) - 80%
3. Dynamic menu to make two above user friendly - 99%

DeskGrid is to help you place windows precisely on the grid (with or without gap)

See:

[![](https://forum.maboxlinux.org/uploads/default/original/2X/3/3fa0df80a17f623f1544ecec2daac3eb7f182a4b.jpeg "Mabox Lab: DeskGrid - arrange windows on the grid") ](https://www.youtube.com/watch?v=Ba_lV-M0I2o)

### How to test/play with it?

Update system to get latest **mabox-tools**.  
Make sure you have dependencies installed:

```auto
yay -S feh slop notify-send.sh

```

Get latest rc.xml config

```auto
mb-reset obrcxml

```

or add to rc.xml (context name=“Frame”)  
those lines:

```auto
     <mousebind action="Press" button="C-S-Left">
        <action name="UnmaximizeFull"/>
        <action name="Execute">
          <command>deskgrid</command>
        </action>
      </mousebind>

```

in case you edit rc.xml by hand run:

```auto
openbox --reconfigure

```

Now you can use Ctrl + Shift + LeftMouseButton to click on the window and play with it.

To see Grid Helper as a background run command:

```auto
drawgrid

```

You can add it to left panel by:

```auto
echo "DeskGrid Helper,drawgrid" >> ~/.config/mabox/places-prepend.csv

```

Cheers

---

<div class="post-metadata">

**Author:** ![piquet](https://forum.maboxlinux.org/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@piquet](https://forum.maboxlinux.org/u/piquet)\
**Post date:** [May 18, 2021, 7:54am UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/2 "2021-05-18T07:54:36Z")

</div>

This is an excellent idea and seems to be working fine so far. I’ll do some more testing.  
Thank you

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [May 18, 2021, 8:18am UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/3 "2021-05-18T08:18:51Z")

</div>

Hi @piquet and welcome to the forum 🙂  
Thanks for your interest and testing.

Btw.. I’m almost ready with the next tool, tentatively called DeskMngr: which allows you to save and restore all windows from the virtual desktop.  
I’ll try to share it and write about it later today.

 ![DeskMngr](https://forum.maboxlinux.org/uploads/default/original/1X/357e9b4ae5525ff25121d91259c6d4496c2078b2.png)

---

<div class="post-metadata">

**Author:** ![piquet](https://forum.maboxlinux.org/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@piquet](https://forum.maboxlinux.org/u/piquet)\
**Post date:** [May 18, 2021, 9:37am UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/4 "2021-05-18T09:37:33Z")

</div>

Only one minor problem so far. Deskgridhelper does not play nice on dual screen setup.  
The image (/tmp/grid.png) is correctly calculated and created but then is displayed only on the primary display. This also puts the help text off screen. This is not a deal-breaker but I thought I would point it out so that others may be made aware of it.

Looking forward to trying deskgrid 😄

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [May 18, 2021, 10:37am UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/5 "2021-05-18T10:37:46Z")

</div>

Thanks for info.  
I don’t have experience with multimonitor setup unfortunately - maybe in the future 😉

Can you share output from `wmctrl -d` and `xrandr --listmonitors` commands?

---

<div class="post-metadata">

**Author:** ![piquet](https://forum.maboxlinux.org/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@piquet](https://forum.maboxlinux.org/u/piquet)\
**Post date:** [May 18, 2021, 12:46pm UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/6 "2021-05-18T12:46:43Z")

</div>

Sure

```auto
0 - DG: 3840x1080 VP: 0,0 WA: 0,38 3840x1010 Home
1 - DG: 3840x1080 VP: 0,0 WA: 0,38 3840x1010 Multimedia
2 * DG: 3840x1080 VP: 0,0 WA: 0,38 3840x1010 Office
3 - DG: 3840x1080 VP: 0,0 WA: 0,38 3840x1010 Graphics
4 - DG: 3840x1080 VP: 0,0 WA: 0,38 3840x1010 Development
5 - DG: 3840x1080 VP: 0,0 WA: 0,38 3840x1010 Network
xrandr --listmonitors
Monitors: 2
 0: +*HDMI1 1920/480x1080/270+0+0 HDMI1
 1: +VGA1 1920/480x1080/270+1920+0 VGA1

```

The two monitors are side by side with the HDMI on the left. The grid.png image is pushed all the way to the left of the HDMI monitor leaving no image on the right VGA monitor and the help text is then off-screen. Maybe feh could be configured to compensate although I have never used it.

I wouldn’t spend too much time on this as users of multi-monitor set ups don’t need to be so tidy with their layouts and the deskgrid is pretty intuitive in use anyway.

You are doing a great job here. I have been using Linux for over 20 years and arch based distros for over 10 and this is the nicest implementation so far.

---

<div class="post-metadata">

**Author:** ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)\
**Post date:** [May 18, 2021, 8:37pm UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/7 "2021-05-18T20:37:37Z")

</div>

I’m not sure if this will work, but you can try:

```auto
feh -N -x -g 3840x1010 --title "DrawGrid helper" /tmp/grid.png

```

---

<div class="post-metadata">

**Author:** ![piquet](https://forum.maboxlinux.org/letter_avatar_proxy/v4/letter/p/7bcc69/32.png) [@piquet](https://forum.maboxlinux.org/u/piquet)\
**Post date:** [May 19, 2021, 8:07am UTC](https://forum.maboxlinux.org/t/deskgrid-place-windows-on-grid-with-or-without-gap-beta/503/8 "2021-05-19T08:07:30Z")

</div>

Yes that works. Thanks, sorry for the delay in replying.
