Skip to main content

Command Palette

Search for a command to run...

Fixing Guake Window Alignment in Multi-Monitor Setups

Updated
3 min read
Fixing Guake Window Alignment in Multi-Monitor Setups

If you’ve ever used Guake (the drop-down terminal for GNOME) with a multi-monitor setup, you may have noticed that on the primary monitor the Guake window sometimes overflows beyond the visible screen area — usually extending past the top or right edges.

This makes Guake slightly annoying to use on the main monitor when you have more than one display connected.


The Problem

On single-monitor setups, Guake aligns perfectly.
But with multiple monitors only the left alignment is fine, with overflows on the top and right out of the visible area.

On the primary monitor (monitor == 0), the window width and vertical alignment can push Guake partially off-screen.


The Solution

After digging through the source code, I found the logic that calculates Guake’s window rectangle in utils.py inside the RectCalculator.set_final_window_rect method.

By default, Guake calculates width and height as a percentage of the monitor’s geometry, then applies horizontal and vertical alignment. But there’s no special handling for the primary monitor in multi-monitor setups.

The fix is a simple adjustment right before resizing/moving the window in /usr/lib/python3/dist-packages/guake/utils.py.

# check for multi monitor setups
# if multiple monitors are detected and the primary monitor is used,
# we need to adjust the window width and position

# log.debug("Number of monitors detected: %s", screen.get_n_monitors())
# log.debug("Current monitor: %s", monitor)
# log.debug("Primary monitor: %s", screen.get_primary_monitor())

if screen.get_n_monitors() > 1 and monitor == 0:
    log.debug("Adjustment for Primary monitor in multi-monitor env applied")
    window_rect.width -= 70          # reduce width
    window_rect.y += 34              # increase top gap

That’s it. With this patch:

  • Guake stays within visible bounds on the primary monitor.

  • Multi-monitor setups behave correctly without affecting single-monitor mode.

Otherwise the top part is hidden by the activities pane and the right side goes beyond visible area (not sure why, the px calculations seem right but visually it’s not)

The commented log debug lines are meant to provide a jumpstart for more advanced tweaks, for eg if your primary monitor is not 0, you might want to find that or use the variable if it keeps changing etc.

While tesing the fix, the simplest way is to run guake from another terminal and restart it with pkill guake && guake -v, no need to delete __pycache__.

Here’s how it looks with the fix.


Making It Permanent !?

If you edit /usr/lib/python3/dist-packages, your changes will be overwritten when Guake updates via your package manager.

Safer approaches:

  1. Run from source – clone the Guake repo, apply the patch, and launch it directly.

  2. Use a Python venv – install Guake in a virtual environment and patch it there.

I don’t recommend either, changing 4 lines in a python file if the issue reappears seems like the simplest solution to me while using your package manager.


Final Thoughts

Sometimes the best fixes are small. Just a couple of lines in utils.py completely solved the misalignment issue for me in a multi-monitor setup. If you’re facing the same problem, give this tweak a try.