[Solved via manual editing] Issue with remembering of recent files in mousepad via ~/.local/share/recently-used.xbel

Technical issues/questions of an intermediate or advanced nature.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Solved via manual editing] Issue with remembering of recent files in mousepad via ~/.local/share/recently-used.xbel

Post#1 by Rava » 16 Jan 2022, 09:01

Solution below in 2nd post

System 5.0rc3 XFCE

I have a question about how the remembering of recent files in mousepad is handled.
I want it to remember two files that I always need to be loaded.
The issue, probably because of an older getting time stamp when these file got added to /home/guest/.local/share/recently-used.xbel, when I open one of them via File / Open Recent / [select file from list] then the 2nd file from that list disappears.

When I open another file as first file instead, both files from the [Open Recent list] disappear.

I know I could e.g. code an autostart event where mousepad is started at startup from XFCE with the two files I want it to recall.

But I am stubborn and want to know if there is a system tweak that gets mousepad (or the system?) to keep the [Open Recent list] even when the file entries have a quite old time stamp when they have been put there.

Another option would be creating a script that updates the time stamp.

As example, this is one entry of the two files in /home/guest/.local/share/recently-used.xbel

Code: Select all

<bookmark href="file:///mnt/sda99/what/ever.txt" added="2021-11-01T10:07:52.691529Z" modified="2021-11-01T10:07:52
.696758Z" visited="2021-11-01T10:07:52.691537Z">
I just changed the file name to one example one. The rest of the entry is a verbatim copy.

But I prefer neither the autostart nor the auto-editing the visited= parameter of the recently-used.xbel approach.

I would prefer if mousepad (or the system?) will no longer delete my recently-used.xbel entries only because they got older.

But I have no idea if such approach is possible, e.g. if there is some kind of system tweak (maybe to be put into a config file and not to be found via the GUI?)
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[Solved via manual editing] Issue with remembering of recent files in mousepad via ~/.local/share/recently-used.xbel

Post#2 by Rava » 19 Jan 2022, 15:26

Update
TL;DR:
Solved my manual editing of recently-used.xbel…


Detailed version:
It worked by manually editing all 4 entries of each file *le sigh* and making no error doing so. Using [insert] key to overwrite the previous text helps. And not using the editor to edit recently-used.xbel which uses these entries itself sure also helps.

Here the diff:

Code: Select all

guest@porteus:~/.local/share$ diff recently-used.xbel recently-used.xbel.2 
16c16
<   <bookmark href="file:///mnt/sda1/f1.txt" added="2021-11-01T10:07:26.208284Z" modified="2021-11-01T10:07:26.213515Z" visited="2021-11-01T10:07:26.208288Z">
---
>   <bookmark href="file:///mnt/sda1/f1.txt" added="2022-01-17T10:07:26.208284Z" modified="2022-01-17T10:07:26.213515Z" visited="2022-01-17T10:07:26.208288Z">
25c25
<           <bookmark:application name="Mousepad" exec="&apos;mousepad %u&apos;" modified="2021-11-01T10:07:26.213510Z" count="2"/>
---
>           <bookmark:application name="Mousepad" exec="&apos;mousepad %u&apos;" modified="2022-01-17T10:07:26.213510Z" count="2"/>
30c30
<   <bookmark href="file:///mnt/sda2/f2.txt" added="2021-11-01T10:07:52.691529Z" modified="2021-11-01T10:07:52.696758Z" visited="2021-11-01T10:07:52.691537Z">
---
>   <bookmark href="file:///mnt/sda2/f2.txt" added="2022-01-17T10:07:52.691529Z" modified="2022-01-17T10:07:52.696758Z" visited="2022-01-17T10:07:52.691537Z">
39c39
<           <bookmark:application name="Mousepad" exec="&apos;mousepad %u&apos;" modified="2021-11-01T10:07:52.696753Z" count="2"/>
---
>           <bookmark:application name="Mousepad" exec="&apos;mousepad %u&apos;" modified="2022-01-17T10:07:52.696753Z" count="2"/>
And in approx 2 months time (or maybe 6 weeks or such) when the same issue reappears, I then try setting the date stamp into the future and look how the system handles that. :D

Additional Info:
The 3rd outdated entry was by Pale Moon, a similar original added date as the two files from mousepad.

Since that entry got purged as well when I tried the above edit in mousepad, it is obvious the purging is a thing that the system does, or maybe a system routine mousepad calls that does the purging, since mousepad would hardly touch an entry meant for another program.

I now also set the date from the Pale Moon entry to a more recent date. (I omitted that part in the diff, using a diff of the unaltered original with the only-mousepad-entries- altered variant)
Cheers!
Yours Rava

Post Reply