Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glassnote

On-screen quick notes/annotation tool to untangle complex ideas.

glassnote.mp4

Roadmap

  • Configurable color palette
  • Configurable keybinds (extend gnctl functionality)
  • 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

Building/Installation

Important

  • glassnote uses the zwlr_layer_shell_v1 and wp_cursor_shape_manager_v1 protocols, which are not supported by all Wayland compositors.
  • gnctl uses systemd and dbus to communicate with glassnote.

Install the following dependencies:

  • libsystemd
  • wayland-client
  • wayland-protocols (≥ 1.32)
  • egl
  • glesv2
  • wayland-egl
  • xkbcommon

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 compile

To optionally install both glassnote and gnctl, run:

meson install

Example Usage

gnctl 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 show to show the overlay
  • gnctl hide to hide the overlay
  • gnctl show || gnctl hide to toggle the overlay

These CLI commands should then be dispatched using your Wayland compositor.

Example Hyprland Config:

# Start glassnote if it is not running, otherwise toggle the overlay
bind = SUPER, R, exec, gnctl show || gnctl hide || glassnote

The tool wheel

While 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.

The text 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.

Keybindings

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-5 will change the color of the stroke
  • E will cycle between the pen, the eraser and the text tool
  • Q/- will decrease the stroke size (or the eraser radius)
  • W/= will increase the stroke size (or the eraser radius)
  • T will toggle the dimmed canvas background
  • Z will undo the last stroke, eraser drag or text edit
  • ESC will close/kill glassnote

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.

Font

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.

About

On screen annotation/notes tool

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages