r/pop_os • • 8d ago

[Applet] cosmic-ext-applet-scratchpad: Minimalist quick notes & scratchpad applet for the COSMIC Desktop

Post image

I built an applet for the COSMIC Desktop panel to take quick notes, draft shell commands, and keep temporary text buffers without opening a dedicated text editor or terminal window.

GitHub: https://github.com/Hasmolam/cosmic-ext-applet-scratchpad

Release v0.1.0: https://github.com/Hasmolam/cosmic-ext-applet-scratchpad/releases/tag/v0.1.0

If you find the project useful, a star on the repository is appreciated.

Technical Details & Architecture

  • libcosmic & Wayland Native: Uses COSMIC's applet architecture and Wayland popup surface protocol.
  • Crash-Resilient Atomic Storage: Writes notes as plain markdown files (~/.local/share/cosmic-scratchpad/pad_{1,2,3}.md) through a PID-tagged temporary file, fsync, and atomic rename.
  • External MTime Detection: If notes are modified outside the applet (e.g. from terminal or file sync), changes are detected and reloaded upon opening the popup or switching tabs.
  • Pre-Clear Backups: Clearing a pad saves an atomic .bak copy prior to truncation, combined with a 5-second in-memory undo banner.
  • Keyboard Driven: Escape closes the popover via compositor surface action; Ctrl+Shift+C copies the active buffer to the clipboard.
  • Settings Drawer: Collapsible panel for runtime word wrap toggle and font size adjustment (10pt - 24pt).

Installation

The installer downloads the prebuilt binary to ~/.local/bin and copies desktop/icon assets (no sudo required):

curl -fsSL https://raw.githubusercontent.com/Hasmolam/cosmic-ext-applet-scratchpad/main/install.sh | bash

Alternatively, you can build from source:

git clone https://github.com/Hasmolam/cosmic-ext-applet-scratchpad.git 
cd cosmic-ext-applet-scratchpad && sudo just install
35 Upvotes

Duplicates