How to hide certain files (eg .xmp) in Dolphin?

A .hidden file with, say, *.xmp, is not working (Dolphin v. 24.12.1). Can someone show me how to keep files from showing in Dolphin?

that is not a “hidden” file

A “hidden” file (or directory) is one whose name begins with a dot.

That is what you can “tune out” by selecting to show “hidden files” or not.

… it starts with a dot …

cave:
I do not use Plasma or Dolphin and am not familiar with the ways it can be configured to “tune out” certain files with certain extensions.

As @Nachlese said, hidden files are files (and directories) whose name starts with a period. This is how UNIX works.

The only modification to that behavior which you can make from within dolphin’s settings is whether dolphin must also hide files with filename suffixes commonly understood to be backup files.

https://superuser.com/questions/826194/how-to-tell-dolphin-which-files-to-hide#1168758

2 Likes

Yes, this link describes exactly what I have been trying but can’t get to work. I form a file in the directory where I want to hide .xmp files, give it an entry like *.xmp, and it does nothing. I’ve even tried entering a specific file name, including extension, and the .hidden file had no effect.

Another problem I’ve had with Dolphin is getting RAW file to “preview in the view” as they say in the Interface configuration. With “RAW Photo Camera Files” box checked my CR3 files do not preview, but they do when I uncheck the box.

Have you, fbt89, tried the .hidden file and got it to work in Dolphin?

I have checked here and it works.
Do you have hidden files enabled/viewable?

Note in the following example the ‘darkened’/translucent icons are ‘hidden’ and would not normally be visible, but I have ‘Show Hidden Files’ enabled.

Imgur

Imgur

Imgur

In case it is important I will also mention that

If this is literal it will not work.
The files must be listed.
A wildcard ( * ) will not work.

2 Likes

This might be a silly suggestion, but have you selected to not show hidden files in Dolphin’s settings?

You can enable/disable hidden files display in Dolphin with the shortcut Ctrl+H.

I just created some test files in a directory with both .txt & .xmp extensions, and I then created a .hidden file with the following lines:

test1.txt
test2.txt
test3.txt
test4.txt
test1.xmp
test2.xmp
test3.xmp
test4.xmp

After saving the .hidden file, I then refreshed the Dolphin view (F5)

When I have Dolphin set to display hidden files, the ones listed in the .hidden file are grayed out:

When I set Dolphin to not display hidden files by using Ctrl+H, then those files are hidden from view:

So the feature seems to be working fine in Dolphin.

I did it a few years ago, but when a file is hidden I tend to forget about it and ran into problems. As scotty65 explains, and I can confirm this process still works in Dolphin

Hidden files have their uses … and there are uncountable files whose canonical name/path is .*** - making them ‘hidden’.
For these reasons, as well as the fact I spend time administrating systems for various purposes … I simply have ‘show hidden files’ enabled perpetually. $HOME would look a little cleaner otherwise … but it would be half of a day, maximum, before I would want to turn it back on for some reason or another.
So no forgetting, but also ‘hiding’ things as a method to get them out of the way is largely a pointless endeavor.

1 Like

Apart from the usual filename or directory starting with a period, there is another way to hide items;

1. Create a file named .hidden in the root of the directory containing the files/directories you wish to hide.

2. Edit that file and list those files/directories (one per line).

3. The effect should be instantaneous, though you will likely need to close and re-open your file manager. An example:

~/.hidden:

My_Hidden_Folder
my_special_file_that_must_not_be_renamed.key

The best achievable using a .hidden file might be to list a preconceived selection of likely filenames to be stored in that directory.

Regards.

1 Like

Adding your pattern to x-trash works where local globbing fails (here with a newly created .mp31 file :wink:

1 Like

You present x-trash as if it is something I should know about but I confess I do not. A search on this forum leads only to here and a wider search has yielded nothing. Can you give me a hint where I can learn more about x-trash?

It is a file association to hide files with specific extensions.

If you open Plasma’s System Settings → Default Applications → File Associations & type x-trash in the filter box, you will then be able to add *.xmp (or any other filetype) to the list of filename patterns:

Once you hit the “Apply” button, the .xmp files will be classed as backup files and hidden by Dolphin.

Note that this will mean that you will no longer be able to open those files automatically with your preferred application if you double-click on them in Dolphin, so using the .hidden file method may be the better option.

1 Like

I’m sorry to have given that impression.

I come from a position of complete ignorance in the matter - I thought the .hidden option was interesting as a ‘tweak’ - but then remember having some messy backup files of different kinds cluttering up folders… so I did what’s called a ‘search’ and found the idea for adding (blender backup) file extensions to x-trash which hides them… but that’s as far as I went.

1 Like

Firstly, a brief overview of application/x-trash mime type:

My opinion is that the however plausible resolution mentioned should not be used to hide random file types. The feature is designed specifically for temporary backup files. As @scotty65 demonstrates, any file you add to the application/x-trash list;

Or, so the theory goes…

It doesn’t seem clear that this will actually work as suggested. I note a comment from Meven Carr in https://bugs.kde.org/show_bug.cgi?id=3212#c80;

As I understand it, the behaviour concerned extra file extensions added to the pre-existing types listed under x-trash; the system default for these types is that they should already be hidden; but the behaviour refers to the adding of new types, which is disabled by default. I have found no information on enabling this.

Indeed, in my own experiments (using the .xml extension) an xml file was seen to be ‘greyed out’ but not hidden (KDE Plasma).

Again, as mentioned;

It’s unfortunate that .hidden doesn’t produce the exact outcome you were looking for, however as I suggested earlier, careful consideration of file names you are likely to use for the *.xmp files might be close enough in practical terms; only you can decide.

Regards.

1 Like

I started this thread thinking I was somehow missing a simple way to hide sidecar files (.xmp). Clearly there is no way to do this in Dolphin and, taking instruction from the many considered responses provided here, I am probably
better off not hiding them anyway.

As usual I have learned some worthwhile things from the considerate people who have taken the time to respond here, and I thank them for that.

The solution for me, then, is what perhaps should have been obvious to me in the first place: Don’t try to manage directories of photographs with Dolphin. I like Dolphin better than any other file browser I’ve ever used, but for dealing with photographs it is better to stick to more appropriate programs like digiKam and Gwenview.

I will mark this as the solution (although technically it is not) because it is the solution for me and I would have avoided all this if my original search had turned up a thread and message like this. (I apologize in advance if this is an improper use of “Solution.” A moderator will no doubt unmark it if it is.)

2 Likes

Far from it - this was an interesting topic, I didn’t know about .hidden and am disappointed by it’s inabilty to handle a glob.

2 Likes

Knowing exactly what you hoped to achieve might have helped as well. As it stands, it was more of an XY problem – all were focused on “X” (how to perform a needed step) rather than “Y” (how to provide a solution for the final outcome).

Nonetheless, an interesting read for others despite there being no real solution found for the posed problem.

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.