From 2604c7438c332c088c6f37087600044fa2fb7157 Mon Sep 17 00:00:00 2001 From: gadb Date: Tue, 25 Nov 2025 10:55:50 +0000 Subject: [PATCH] Add (sort of) unique identifiers to notes. Why? This enables me to add drag-to-reorder functionality to StyncyNotes - and android app that enables you to view/edit your sticky notes on your android phone (should you have one). --- usr/lib/sticky/sticky.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/lib/sticky/sticky.py b/usr/lib/sticky/sticky.py index 60b01b4..7e706b9 100755 --- a/usr/lib/sticky/sticky.py +++ b/usr/lib/sticky/sticky.py @@ -3,6 +3,7 @@ import json import os import sys +import uuid import gi gi.require_version('Gdk', '3.0') @@ -125,6 +126,7 @@ def __init__(self, app, parent, info={}): self.changed_timer_id = 0 self.invalid_cache = False + self.id = info.get('id', str(uuid.uuid4())) self.x = info.get('x', 0) self.y = info.get('y', 0) self.height = info.get('height', self.app.settings.get_uint('default-height')) @@ -393,6 +395,7 @@ def get_info(self): (width, height) = self.get_size() info = { + 'id': self.id, 'x': self.x, 'y': self.y, 'height': self.height,