Disable GTK "recently used files"

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

Disable GTK "recently used files"

#1 Post by cimarron »

It took me a while to find the solution to this, and lots of other linux users have searched for it as well (including this puppy thread). There's a file, /root/.local/share/recently-used.xbel, that gtk uses to log files you've opened. It's used by many applications and can hold quite a length of history. This is also what's referenced when opening a file and selecting "recently used" in the dialog.

If you delete recently-used.xbel, it's quickly replaced. If you change write permissions, those are overridden. You can use "chattr +i" to prevent writing to it, but apparently a temp file is written first and this will result in lots of disk writes as it attempts again and again to write to recently-used.xbel (there can also be lots of errors displayed if certain applications are run in terminal, as they keep trying to write to this file).

But for GTK2, which I think most puppies use, the logging can be stopped if this line is added to /root/.gtkrc.mine:

Code: Select all

gtk-recent-files-max-age=0
I think GTK needs to be restarted for this setting to be used. I just changed the GTK theme and changed back, and it worked. The recently-used.xbel file is still created, but it holds no data.

To revert to normal logging, just remove that line (and restart GTK).

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

Re: Disable GTK "recently used files"

#2 Post by MochiMoppel »

Just curious: Why do you want to disable it? I understand that there are many users who want the same, but I've seen other threads where users asked to make this file more accessible. In the thread you mentioned tha the OP was concerned about the size of the file. Can't this be controlled by a value of 1 or 2 (days?)?

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#3 Post by cimarron »

For some people there's also a privacy concern, especially if the computer is used by more than one person. Similar to not wanting to be tracked by Ubuntu's zeitgeist.

I'm not sure if I want to keep the "recently used" functionality or not. But I like to be able to turn it off.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

cimarron wrote:For some people there's also a privacy concern, especially if the computer is used by more than one person.
People who share their private pupsave file with persons they don't trust should certainly be concered :lol: OK, but that's a different topic.
But I like to be able to turn it off.
Yes, it's always good to be in control. Even if turning off might be a bit drastic, turning it down sounds like a good idea. The default is 30 days. That's a long time to accumulate a massive amount of data. Setting it to 2-3 days seems more appropriate.

It is also possible to limit the number of recently used files that appear in the Open/Save dialog:

Code: Select all

gtk-recent-files-limit=20
limits the number to 20. Default is 50.

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#5 Post by cimarron »

Does the gtk-recent-files-limit setting work for GTK2? I've seen it recommended as a GTK3 solution, but I think when I tried it there was no effect (or maybe it just doesn't work to set it to 0?).

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#6 Post by MochiMoppel »

cimarron wrote:Does the gtk-recent-files-limit setting work for GTK2? I've seen it recommended as a GTK3 solution, but I think when I tried it there was no effect (or maybe it just doesn't work to set it to 0?).
Yes,it works for GTK2. It's even older than the gtk-recent-files-max-age setting, however as both settings share the same file gtk-recent-files-limit will also result in zero (no matter what value is set) if you set gtk-recent-files-max-age=0. In fact this seems to be the only way to set the Open/Save files to zero. When I tried

Code: Select all

gtk-recent-files-max-age=2
gtk-recent-files-limit=0 
the Open/Save dialog still shows 1 file

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#7 Post by MochiMoppel »

Sorry for bumping this very old thread but it might answer BarryK's question in this thread on how to limit the size of the file recently-used.xbel.

Apparently there is no elegant way to limit the size or number of items in this file. Setting gtk-recent-files-max-age to 5 (days) can lead to a massive amount of items, but if the user then takes a one week holiday and after that opens any file in geany, the number of items will be down to 1. Not good :cry:

IMO the best bet is too keep the default settings untouched. They should work for most users.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#8 Post by musher0 »

(Edit: Quote added, bold by me)
MochiMoppel wrote:Sorry for bumping this very old thread but it might answer BarryK's question in this thread on how to limit the size of the file recently-used.xbel.

Apparently there is no elegant way to limit the size or number of items in this file. Setting gtk-recent-files-max-age to 5 (days) can lead to a massive amount of items, but if the user then takes a one week holiday and after that opens any file in geany, the number of items will be down to 1. Not good :cry:

IMO the best bet is too keep the default settings untouched. They should work for most users.
Are you sure geany does not have its own file list? Independent of the general xbel file, at
/root/.config/geany/geany.conf, line 156 or therabouts:
[files]
recent_files=
(list of text files one processed recently)
IHTH
Last edited by musher0 on Sun 04 Aug 2019, 19:37, edited 2 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#9 Post by MochiMoppel »

@musher0
The subject of this thread is /root/.local/share/recently-used.xbel

B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

#10 Post by B.K. Johnson »

Hi Mochi
Can you clarify for me what "used" in this context means? As implemented in upupbb, it seems to record/show only "written/saved" files.
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#11 Post by musher0 »

MochiMoppel wrote:@musher0
The subject of this thread is /root/.local/share/recently-used.xbel
I edited my previous post to make it clearer. You yourself mentioned geany's history as
dependent of recently-used.xbel. It is not. But don't believe me, please double-check
yourself.

< recently-used.xbel > is hardly the only history-collecting file on any Linux.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#12 Post by MochiMoppel »

B.K. Johnson wrote:Can you clarify for me what "used" in this context means? As implemented in upupbb, it seems to record/show only "written/saved" files.
What "used" means is largely up to the applications that use recently-used.xbel. Most often applications (e.g. geany, leafpad, abiword, gnumeric) would write to this file as soon as they open a file. This can quickly fill this file with irrelevant items, e.g. files that the user opened in error. The original purpose might have been to serve as a cross-platform or cross-application bookmark file, but I've never seen an application that uses it for this purpose. The fact that a history of opened files is created without any interaction by the user might explain why many users have privacy concerns and why users like the OP want to get rid of this file.

I have no clue what upupbb implemented since I've never used it or seen the code. I can however say that MMview reads recently-used.xbel but never writes to it, so for merely reading text files a viewer might be preferable to an editor.

User avatar
8Geee
Posts: 2181
Joined: Mon 12 May 2008, 11:29
Location: N.E. USA

#13 Post by 8Geee »

The simplest way to deal with the file is to open Geany, then load the file. Using CTRL+A select all, then press BACKSPACE key. SAVE the file as blank.

Removing the file and the xbel extension does not work. Editing the file to blank does. BTW, close Geany with the blank file intact... EZ maintanence. Also, the CUPS error log should be edited in this way.

Regards
8Geee
Linux user #498913 "Some people need to reimagine their thinking."
"Zuckerberg: a large city inhabited by mentally challenged people."

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#14 Post by s243a »

Maybe setup a cron job to delete this file every hour and also setup a script to delete it at shutdown.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#15 Post by MochiMoppel »

8Geee wrote:Removing the file and the xbel extension does not work. Editing the file to blank does
Does not.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#16 Post by MochiMoppel »

B.K. Johnson wrote:As implemented in upupbb, it seems to record/show only "written/saved" files.
After some more research I can say that I find this claim highly unlikely.
I can't test upupbb but would appreciate if someone can shed light on what upupbb is doing.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#17 Post by musher0 »

I'm in jrb's upupBB-light right now, and all entries in the recently-used.xbel file have the
usual three time-stamps: added, modified, visited.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#18 Post by MochiMoppel »

Sure, but as far as I understand B.K.Johnson upupbb displays a menu based on this file, and this menu contains only files that were recently saved but not those which were merely opened.
AFAIK the timestamps recorded in the recently-used.xbel file are not sufficient to make this distinction.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#19 Post by musher0 »

That menu could be reprogrammed to make such distinctions, yes?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#20 Post by MochiMoppel »

Yes, but if B.K. Johnson's guess could be verified then there would be no need to reprogram anything, right?

Post Reply