How iamshrisawant/digi-notes works
Purpose and Entry Points
DigiNotes is a native PySide6 desktop sticky-notes manager. It runs primarily from the system tray, maintains multiple frameless desktop note windows, and persists note text and layout locally. Launchers are run.sh and run.bat; application startup and process ownership begin in src/main.py.
Application Bootstrap and Lifetime Management
src/main.py creates the Qt application, enforces a single running instance with QLockFile, initializes tray actions, and owns note lifecycle through its NoteManager. This is the top-level control boundary: tray/dashboard actions create, show, hide, or remove note windows rather than a server or browser route handling them.
Paths: src/main.py, run.sh, run.bat
Sticky Note Window Layer
Each desktop note is a custom borderless Qt window implemented by StickyNote. It manages title-bar interactions, drag positioning, pin/stays-on-top behavior, collapse-to-indicator behavior, opacity/hover presentation, and coordination with formatting help. It is the boundary between persisted note state and OS window-management APIs.
Paths: src/note_window.py, src/styles.py
Markdown Editing and Interaction Engine
The embedded editor is a QTextEdit subclass with a custom syntax highlighter. It transforms Markdown input into in-place rich styling, hides or reveals syntax according to cursor context, continues lists on Enter, and handles click-driven checkbox state changes. Note text remains Markdown rather than being converted into a separate document format.
Paths: src/editor.py, src/note_window.py
Dashboard Control Plane
The centralized dashboard lists active notes and provides search, creation, visibility toggling, deletion, and drag-and-drop activation. It operates as a management surface over the note instances owned by the main manager, rather than storing an independent note model.
Paths: src/dashboard.py, src/main.py
Settings, Themes, and Runtime Overrides
The settings dialog controls application defaults and live per-note layout/theme overrides. Styling is centralized as Qt stylesheet/theme definitions, including glassmorphic colors and hover-transparency behavior; note windows consume these presentation settings.
Paths: src/settings.py, src/styles.py, src/note_window.py
Persistence and System Integration
Persistence is local filesystem storage: note bodies are standard Markdown under data/notes/<id>.md; corresponding JSON metadata stores geometry and appearance; general settings reside in data/config.json (created at runtime, not present in the tree). No backend service or remote datastore is indicated. AutostartManager bridges platform startup mechanisms: Linux desktop entries, Windows Registry, and macOS launch agents.
Paths: src/autostart.py, src/main.py, src/settings.py
Runtime and Platform Boundaries
The runtime is Python with Qt 6 via PySide6-Essentials; markdown-it-py is an installed dependency. The application depends on OS tray and windowing facilities. On Linux, run.sh forces Qt’s XCB backend to preserve coordinate and always-on-top behavior that Wayland may restrict.
Paths: requirements.txt, run.sh, src/main.py
Main entry points: note_window.py Sticky note window · main.py Application manager · settings.py Settings dialog · autostart.py Autostart manager
Components 16
Launch & Runtime
- Linux launcher · Forces Qt XCB on Linux.
run.sh - Windows launcher
run.bat - Python dependencies · Provides PySide6 and markdown-it-py.
requirements.txt
Desktop Application
- Application manager · Owns the Qt lifetime, singleton lock, tray, and note lifecycle.
src/main.py - System tray
src/main.py - Note manager · Creates, shows, hides, and removes note windows.
src/main.py
Note UI & Control
- Sticky note window · Bridges persisted state to desktop window behavior.
src/note_window.py - Markdown editor · Edits Markdown with rich styling, lists, and checkbox interactions.
src/editor.py - Dashboard · Manages active note instances without an independent model.
src/dashboard.py - Settings dialog · Controls defaults and live per-note overrides.
src/settings.py - Themes and styles
src/styles.py
Local Storage & OS
- Markdown note bodies · Stored as data/notes/<id>.md.
- Note metadata · Stores geometry and appearance per note.
- Application config · Runtime-created data/config.json.
- Autostart manager · Uses desktop entries, Registry, or launch agents.
src/autostart.py - OS windowing and tray
Connections 19
- Linux launcher → Application manager: launches
- Windows launcher → Application manager: launches
- Python dependencies → Application manager: provides runtime
- Application manager → System tray: initializes
- Application manager → Note manager: owns
- Note manager → Sticky note window: manages instances
- System tray → Note manager: invokes actions
- Dashboard → Note manager: controls notes
- Sticky note window → Markdown editor: embeds
- Sticky note window → Themes and styles: uses
- Settings dialog → Themes and styles: selects themes
- Settings dialog → Sticky note window: applies overrides
- Sticky note window → Markdown note bodies: reads and writes text
- Sticky note window → Note metadata: persists layout
- Settings dialog → Application config: persists defaults
- Settings dialog → Autostart manager: configures
- Autostart manager → OS windowing and tray: registers startup
- Application manager → OS windowing and tray: uses Qt platform APIs
- Sticky note window → OS windowing and tray: controls window state