DEV Community

Cover image for Quick Notes in Memos with noteSS: Minimalism in Pure C and GTK 4
Traliran
Traliran

Posted on

Quick Notes in Memos with noteSS: Minimalism in Pure C and GTK 4

Heavyweight Electron-based applications often consume hundreds of megabytes of RAM just to send text. I have always valued speed, autonomy, and control over my data. That is why I created noteSS — an alternative approach based on the principles of the KISS philosophy (Keep It Simple, Stupid). It is an ultra-light desktop application for Linux, designed for instantly dumping notes into the self-hosted Memos service.

The concept is extremely simple: call up a compact floating window, type text, press Ctrl+Enter — and the entry immediately goes to the server via the Memos API, after which the window closes automatically.

Why I Created the Lightweight noteSS Client for Memos

I wrote the application in pure C, using the GTK 4 graphics library and the libcurl networking library. The project deliberately has no third-party JSON parsers or unnecessary dependencies: I implemented safe escaping of special characters manually. Because of this, the utility launches instantly and consumes virtually no system resources.

Key Features and Functions of noteSS

  • Non-blocking UI

    HTTP POST requests are performed in a separate background pthread, and the interface is updated via g_idle_add.

  • Standalone offline cache

    If the server or network is unavailable, the note is saved to disk and automatically uploaded on the next launch.

  • Keyboard control

    The window opens with instant focus on the input field. Ctrl+Enter sends the text, and Escape closes the window.

  • XDG security standards

    The configuration and cache are created with restricted access permissions (chmod 600).

How to Install Dependencies and Build noteSS on Linux

To build the project, you will need standard compilation tools and the GTK 4 and libcurl libraries.

Installing Package Dependencies

Arch Linux:

sudo pacman -S gtk4 curl base-devel pkgconf
Enter fullscreen mode Exit fullscreen mode

Ubuntu / Debian:

sudo apt install libgtk-4-dev libcurl4-openssl-dev build-essential pkgconf
Enter fullscreen mode Exit fullscreen mode

Fedora:

sudo dnf install gtk4-devel libcurl-devel gcc make pkgconf-pkg-config
Enter fullscreen mode Exit fullscreen mode

Building from Source and Quick Launch

The build is done through the standard Makefile or directly via gcc:

git clone https://github.com/Traliran/notess
cd notess
make
./notess
Enter fullscreen mode Exit fullscreen mode

To build with a single command without a Makefile:

gcc main.c cache.c -o notess $(pkg-config --cflags --libs gtk4 libcurl) -lpthread
Enter fullscreen mode Exit fullscreen mode

Optional installation into the system:

sudo make install
Enter fullscreen mode Exit fullscreen mode

The command installs the binary to /usr/local/bin/notess.

Configuring noteSS and Integrating with the Memos API

On first launch, or if there is no config, noteSS opens a graphical initial setup window. The entered data is automatically saved to the file:

$XDG_CONFIG_HOME/noteSS/config.conf
Enter fullscreen mode Exit fullscreen mode

with chmod 600 permissions.

The configuration file format is key=value:

# noteSS config (chmod 600)
memos_url=https://memos.example.com
access_token=memos_pat_xxx
Enter fullscreen mode Exit fullscreen mode

How Network Requests Are Formed

The application sends a POST request to the Memos API with the following headers:

Content-Type: application/json
Authorization: Bearer {access_token}
Enter fullscreen mode Exit fullscreen mode

The request body contains formatted JSON:

{"content": "your text"}
Enter fullscreen mode Exit fullscreen mode

Offline Cache Operation and noteSS Project Architecture

If there is no network connection, noteSS saves the text to the directory:

$XDG_CACHE_HOME/noteSS
Enter fullscreen mode Exit fullscreen mode

as a file:

note-<epoch>-<pid>-<counter>.txt
Enter fullscreen mode Exit fullscreen mode

Access permissions are 600.

On each subsequent start, the application uploads the accumulated files to the server in the background using the FIFO principle — oldest first. After receiving an HTTP 200 or HTTP 201 response, the sent file is automatically deleted from disk.

Source Code Structure

  • main.c — UI logic, config handling, manual JSON escaping, and the curl thread.
  • cache.c / cache.h — local cache management and background sending.
  • Makefile — build and installation scripts.

Conclusion

If you bind noteSS to a global hotkey in your window manager — for example, in i3, Sway, or GNOME — you get a fast and autonomous tool for instantly capturing ideas.

Top comments (0)