Disable GTK "recently used files"

How to do things, solutions, recipes, tutorials
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#31 Post by s243a »

MochiMoppel wrote:
s243a wrote:I'm not sure if it has been mentioned or not but one way to disable this is to delete the folder that contains the file (I.e. ~/.local).
Maybe hasn't been mentioned because it doesn't work ? :wink:
It worked for me but it might depend on which programs are using it. Also prior to using any program which writes to this folder one could drop the permissions of said program (e.g. runasspot) so that said program can't write to the folder. However, don't run as spot. Run as a user without a home folder .
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

#32 Post by MochiMoppel »

recently-used.xbel is created in whatever directory the environment variable XDG_DATA_HOME is assigned to.
In my Puppy XDG_DATA_HOME is set to /root/.local/share, so the file location becomes ${XDG_DATA_HOME}/recently-used.xbel.

Removing /root/.local/share can prevent the saving of recently-used.xbel , but only as long as no other program recreates it. Parcellite is such a program. Parcellite doesn't care about XDG_DATA_HOME, it has this directory hard coded and creates it when it doesn't exist.

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

#33 Post by s243a »

MochiMoppel wrote:recently-used.xbel is created in whatever directory the environment variable XDG_DATA_HOME is assigned to.
In my Puppy XDG_DATA_HOME is set to /root/.local/share, so the file location becomes ${XDG_DATA_HOME}/recently-used.xbel.

Removing /root/.local/share can prevent the saving of recently-used.xbel , but only as long as no other program recreates it. Parcellite is such a program. Parcellite doesn't care about XDG_DATA_HOME, it has this directory hard coded and creates it when it doesn't exist.
What if you set XDG_DATA_HOME=/dev/null
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

#34 Post by MochiMoppel »

s243a wrote:What if you set XDG_DATA_HOME=/dev/null
Brutal, but works.
However symlinking /root/.local/share/recently-used.xbel to /dev/null would not work

If you only want to prevent certain applications to access the .xbel file you can redefine XDG_DATA_HOME before executing the application, e.g this will start geany with a disabled .xbel file:

Code: Select all

XDG_DATA_HOME=/dev/null geany
Not surprisingly a barrage of error messages will follow:

Code: Select all

(geany:6698): Gtk-WARNING **: Attempting to read the recently used resources file at `/dev/null/recently-used.xbel', but the parser failed: Failed to open file '/dev/null/recently-used.xbel': Not a directory.

(geany:6698): Gtk-WARNING **: Attempting to store changes into `/dev/null/recently-used.xbel', but failed: Failed to create file '/dev/null/recently-used.xbel.VCML6Z': Not a directory

(geany:6698): Gtk-WARNING **: Attempting to set the permissions of `/dev/null/recently-used.xbel', but failed: Not a directory

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

#35 Post by s243a »

MochiMoppel wrote:
s243a wrote:What if you set XDG_DATA_HOME=/dev/null
Brutal, but works.
However symlinking /root/.local/share/recently-used.xbel to /dev/null would not work

If you only want to prevent certain applications to access the .xbel file you can redefine XDG_DATA_HOME before executing the application, e.g this will start geany with a disabled .xbel file:

Code: Select all

XDG_DATA_HOME=/dev/null geany
Not surprisingly a barrage of error messages will follow:

Code: Select all

(geany:6698): Gtk-WARNING **: Attempting to read the recently used resources file at `/dev/null/recently-used.xbel', but the parser failed: Failed to open file '/dev/null/recently-used.xbel': Not a directory.

(geany:6698): Gtk-WARNING **: Attempting to store changes into `/dev/null/recently-used.xbel', but failed: Failed to create file '/dev/null/recently-used.xbel.VCML6Z': Not a directory

(geany:6698): Gtk-WARNING **: Attempting to set the permissions of `/dev/null/recently-used.xbel', but failed: Not a directory
Maybe redirect standard error to some kind of error filter function. For instance such a function could remove the offending lines with a statement like:

Code: Select all

 grep -v recently-used.xbel
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

#36 Post by MochiMoppel »

s243a wrote:Maybe redirect standard error to some kind of error filter function.
???
These warnings are good!. They can tell you if and how applications try to use the .xbel file. This is valuable information, don't redirect it. At least not yet.

User avatar
perdido
Posts: 1528
Joined: Mon 09 Dec 2013, 16:29
Location: ¿Altair IV , Just north of Eeyore Junction.?

#37 Post by perdido »

s243a wrote:
MochiMoppel wrote:recently-used.xbel is created in whatever directory the environment variable XDG_DATA_HOME is assigned to.
In my Puppy XDG_DATA_HOME is set to /root/.local/share, so the file location becomes ${XDG_DATA_HOME}/recently-used.xbel.

Removing /root/.local/share can prevent the saving of recently-used.xbel , but only as long as no other program recreates it. Parcellite is such a program. Parcellite doesn't care about XDG_DATA_HOME, it has this directory hard coded and creates it when it doesn't exist.
What if you set XDG_DATA_HOME=/dev/null
Or this

Code: Select all

export XDG_DATA_HOME=/tmp/
Interesting discussion.

Post Reply