[HowTo] Recover Sticky Notes on the Desktop

Hello, buddies!
If you, like me, have lost your sticky note widgets and want to recover them, this tutorial is for you:

  1. Visit ~/.local/share/plasma_notes and run: ls -lt. Find your sticky notes. You can use cat to see the content of your sticky notes. You need to save their filenames. They look as UUIDs: 481e8b3e-7ce4-49ff-bd2d-24b566cd8c.
  2. Create a new widget with a sticky note where it was earlier.
  3. Find its filename in the plasma_notes folder.
  4. Open ~/.config/plasma-org.kde.plasma.desktop-appletsrc in your preferred editor.
  5. Find the new filename in this file and replace it with the old filename that you found in the first step.
  6. Repeat 2–5 steps until you have recreated all your sticky notes.
  7. Logout.
  8. Login.
  9. Profit!
2 Likes

In case you got your note empty due to plasma crash:

First of all try not to write on disk.

How to recover your lost plasma notes via Photorec:

Install the Testdisk

$ sudo apt install testdisk

sudo pacman -S testdisk

Mod edit:- Please only contribute content suitable for Manjaro.

Run photorec as root

$ sudo photorec

  1. Select the disk with the lost files using the Down/Up arrow keys and press “Enter” to [Proceed ].
  2. Select a partition using the ‘Down/Up’ arrow keys, then select [File Opt] using the ‘Right’ arrow key and press ‘Enter’.
  3. Press the ‘s’ key to reset the selection of all file types, then scroll down and select only file types tx? and txt using the ‘Space’ key, and then press the ‘b’ key and then ‘Enter’ to save this selection.
  4. Press the ‘Q’ button to return to the previous partition selection screen.
  5. Use the ‘Left’ arrow key to select [ Search ] and press ‘Enter’.
  6. Select the correct file system for your partion and press ‘Enter’.
  7. Now use the ‘Down/Up’ arrow keys to select the destination folder where the recovered files will be placed (don’t select the same partition, use another mounted partition with enough space) and press the ‘C’ key to start the recovery search.

When finished, you got several recup_dir.* folders in the destination folder with a large number of files recovered with Photoreс. Now it’s time to navigate to the destination folder (via cd) containing the recup_dir.* folders.
and run this command to find the files containing the recovered notes:

$ ls -d recup_dir.* | while read i; do cd "$i"; grep -l '<html><head><meta name="qrichtext"' $(pwd)/*; cd ..; done

/media/user/data/rec/recup_dir.149/f134969072.html
/media/user/data/rec/recup_dir.150/f135503232.html
/media/user/data/rec/recup_dir.151/f138317200.html
/media/user/data/rec/recup_dir.159/f153771840.html
/media/user/data/rec/recup_dir.179/f195561096.html
/media/user/data/rec/recup_dir.180/f196286808.html
/media/user/data/rec/recup_dir.180/f196407856.html
/media/user/data/rec/recup_dir.180/f196544944.html
/media/user/data/rec/recup_dir.180/f196554976.html
/media/user/data/rec/recup_dir.196/f324575728.html
/media/user/data/rec/recup_dir.198/f325003864.html
/media/user/data/rec/recup_dir.81/f71891808.html
/media/user/data/rec/recup_dir.94/f90950656.html
/media/user/data/rec/recup_dir.94/f91196936.html
/media/user/data/rec/recup_dir.96/f92791792.html