Skip to content

KeremSoke/mate-screenruler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MATE ScreenRuler

MATE ScreenRuler is a lightweight on-screen ruler written with GTK3. It helps designers, developers, and QA engineers measure pixel distances precisely while working across multiple monitors or desktop environments.

The application is designed to behave like a native MATE utility but works well on any modern GTK-based desktop. It follows the keyboard/mouse UX conventions of the classic KRuler while adding quality-of-life improvements such as center-origin measurements, high-contrast overlays, and a global menu for desktops that support it.


Features

  • Horizontal & Vertical rulers — dynamically rotate between orientations with a single keystroke or middle-click.
  • Precise measurements — tick marks every 10 px, medium ticks at 50 px, and large ticks at 100 px with numeric labels.
  • Configurable origin — measure from the left/top edge, right/bottom edge, or from the center.
  • Interactive indicator — hover to display the live measurement with an overlay and optional percentage mode.
  • Theming options — choose a background colour, opacity, and font via the Preferences dialog.
  • App & context menus — right-click for quick actions; the same actions are exported to a global app menu when supported.
  • Persistent preferences — settings are saved via GSettings and restored on the next launch.

Controls & Shortcuts

Mouse

  • Left-click & drag on the body: move the ruler.
  • Left-click & drag on the end handles: resize the ruler.
  • Middle-click: rotate between horizontal and vertical.
  • Right-click: open the context menu (Rotate, Direction toggle, Center Origin, Percentage Mode, Preferences, About, Quit).
  • Scroll while holding the left button: nudge the offset (only in pixel mode).

Keyboard

Key / Gesture Action
R Rotate between horizontal and vertical
Shift+R Toggle measurement direction (Right→Left / Bottom→Up)
C Toggle center-origin mode
P Toggle percentage mode
O Open offset dialog
Arrow keys Move the ruler by 1 px (hold Shift for 10 px)
F1 Show About dialog
Ctrl+, Open Preferences
Ctrl+Q Quit

Preferences

Open Preferences from the context menu (Right-click → Preferences) or via Ctrl+,. The dialog provides:

  • Window
    • Orientation (Horizontal / Vertical)
    • Always on top (keeps the ruler above other windows)
  • Appearance
    • Background colour (RGBA)
    • Opacity slider (0–100 %)
    • Font selector for tick labels
  • Scale
    • Right-to-left / Bottom-to-up direction toggle
    • Center origin toggle (mutually exclusive with RTL layout)
    • Absolute offset (integer adjustment)
    • Percentage mode toggle

Colour and font chooser dialogs automatically drop the “always on top” flag so they appear above the ruler. The flag is restored when you close the chooser or refocus the Preferences window.


Building from Source

Dependencies

Install the build dependencies (package names shown for Debian/Ubuntu-based distributions):

sudo apt install \
  build-essential meson ninja-build pkg-config \
  libgtk-3-dev libglib2.0-dev libgdk-pixbuf2.0-dev \
  libpango1.0-dev libcairo2-dev

Configure & Compile

meson setup build
meson compile -C build

Run from the Build Tree

./run.sh

Install System-wide

sudo meson install -C build
sudo glib-compile-schemas /usr/local/share/glib-2.0/schemas/

Set a different prefix by passing --prefix=/path to meson setup.

Tips

  • Hold Shift while dragging the handles to fine-tune the ruler length pixel-by-pixel.
  • Use percentage mode (P) for responsive design work — the overlay indicates the cursor location from 0 % to 100 %.
  • Combine center origin with vertical orientation to measure distances from the midpoint of a screen or element.

Global Menu / AppMenu Integration

  • Current: Appmenu doesn't appear in global menu, menu is implemented as right-click context menu only
  • Action Needed: Add proper GMenuModel/GtkApplication menu support for global menu integration

License

MATE Screen Ruler is released under the GPL-3.0-or-later license. See the header of each source file for copyright information.

About

A screen ruler util for MATE Desktop

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors