glassnote.mp4
- Configurable color palette
- Configurable keybinds (extend
gnctlfunctionality) - Instanced line rendering
- Antialiased line rendering
- Rounded line joins + line caps
- Online line simplification algorithm
- Toggleable canvas
- Touch support
- Tablet support (lol)
- Undo support
- Eraser tool
- Text tool
Important
glassnoteuses thezwlr_layer_shell_v1andwp_cursor_shape_manager_v1protocols, which are not supported by all Wayland compositors.gnctlusessystemdanddbusto communicate withglassnote.
Install the following dependencies:
libsystemdwayland-clientwayland-protocols(≥ 1.32)eglglesv2wayland-eglxkbcommon
No font library is needed: glyphs are vector outlines compiled into src/font_data.h (see
Font).
Then run:
git clone https://github.com/raybbian/glassnote
cd glassnote
meson setup build
cd build
meson compileTo optionally install both glassnote and gnctl, run:
meson installgnctl is a CLI tool that assists in the functionality of glassnotes, allowing you to dim the glassnote overlay to access the underlying wayland surface.
When glassnote is running, use
gnctl showto show the overlaygnctl hideto hide the overlaygnctl show || gnctl hideto toggle the overlay
These CLI commands should then be dispatched using your Wayland compositor.
# Start glassnote if it is not running, otherwise toggle the overlay
bind = SUPER, R, exec, gnctl show || gnctl hide || glassnoteWhile the overlay is active, a wheel in the bottom-left corner shows what you are drawing with. The hub previews the current tool — a filled dot at the real brush size for the pen, a hollow ring sized to the eraser, a T for the text tool — and the five palette colors fan out on an arc around it.
Click the hub to cycle pen → eraser → text, or click a swatch to pick that color. The eraser removes only the ink under its circle, splitting strokes rather than deleting them whole; one drag counts as a single undo step.
Right-click and drag erases from anywhere, without switching tools — let go and you are back on the pen. It uses the same eraser radius as the eraser tool.
Text boxes are transparent and a fixed size. With the text tool selected, click empty canvas to start a new one, or click an existing box to put the caret where you clicked. A border appears around whichever box is under the pointer, and around the one you are editing.
- Drag a box to move it; a click that does not move is a caret placement instead
- Enter starts a new line, arrows/Home/End navigate, and held keys repeat
- Escape leaves the box — a second Escape quits, as it always has
- Ctrl+Z undoes without leaving the box first
- The eraser deletes a whole box when swept over it, rather than nibbling at the letters
One editing session is one undo step, however much you type in it, and a box left empty is discarded rather than cluttering the canvas. Text takes the palette color it was created with, so pick the color before you start typing.
Glyphs are drawn as polylines through the same renderer as the ink, so text is resolution independent and needs no font dependency. Coverage is ASCII; anything else draws as a hollow box.
glassnote allows you to change the cursor stroke and size while the overlay is active.
- Left-click drags with the current tool; right-click drags always erase
1-5will change the color of the strokeEwill cycle between the pen, the eraser and the text toolQ/-will decrease the stroke size (or the eraser radius)W/=will increase the stroke size (or the eraser radius)Twill toggle the dimmed canvas backgroundZwill undo the last stroke, eraser drag or text editESCwill close/killglassnote
While a text box has focus these single-letter shortcuts type instead, so E, T and Z insert
characters. Use Escape to leave the box first, or Ctrl+Z to undo without leaving it.
The text tool draws with the Hershey Sans 1-stroke vector font, compiled into src/font_data.h by
tools/gen_font.py. The generated header is committed, so the build has no font dependency; re-run
the script only to regenerate it.
The Hershey Fonts were originally created by Dr. A. V. Hershey while working at the U. S. National Bureau of Standards.
The format of the Font data in this distribution was originally created by James Hurt, Cognition, Inc., 900 Technology Park Drive, Billerica, MA 01821.
The Hershey font data may be used by anyone for any purpose, commercial or otherwise, provided the
acknowledgements above are distributed with it and it is not converted into the NTIS eight-byte
"xxx yyy:" point format. The SVG conversion this is derived from was made in 2019 by Windell H.
Oskay (www.evilmadscientist.com), by way of emergent.unpythonic.net/software/hershey.