elementary/files

Hiding Files and Folders Without Adding dot in the File Name

Closed this issue · 9 comments

hrstwn commented

What Happened?

In Nautilus and probably other file browsers too (I tried on KDE Index) it is possible to hide files and folders without adding a dot in front of their names. We can list the names of the folders and files inside a text file called .hidden, which will hide them.

I need to do this because one of my device drivers puts its configuration files in the home directory and renaming them could potentially remove my settings. I want to declutter by hiding them but without renaming them. One way to do that is by listing them on a .hidden file as I mentioned before.

Steps to Reproduce

  1. Want to hide file without renaming
  2. Can't do anything, I have to rename

Expected Behavior

Hide every file and folder listed in .hidden

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

No response

Hardware Info

No response

I wasn't aware of this facility - is there a .hidden file in every folder?

hrstwn commented

No, we make the file in the directory that we want.
It’s not very elegant, I wish we had a more friendly implementation. Like in Windows maybe?
Here's a screenshot of Index with folder blenderkit_data hidden:
Screenshot from 2023-10-22 09 10 46
Here's the .hidden file inside ~/:
Screenshot from 2023-10-22 09 12 32

Maybe could add a metadata flag to the each file that we want to hide, in the same way we do with the color tag and (for folders) sort order.

hrstwn commented

It's probably better than supporting .hidden since it's not very discoverable at all.

I've pushed a PR implementing this feature using a metadata attribute. Seems to work OK. Have to see how much traction it gets.

hrstwn commented

Thanks. I honestly don't understand much of how it could work best. Just wanted to point out that such feature existed in other file browsers.

@hrstwn Unfortunately the project leader was reluctant to introduce new UI (a menu option) which is required by the simpler, more efficient metadata solution. Could you advise whether in other file managers implementing the .hidden file solution there is any UI provided to add/remove uris or is something that you have to do using a separate text editor?

sryze commented

Nautilus supports .hidden files but they don't provide a UI for it. It appears to be a feature of GIO rather than Nautilus itself, maybe that's why.

It would be useful it elementary OS supported .hidden too.

@sryze I have now pushed a PR supporting the Gio functionality to read a .hidden file (simpler than I thought 😛 ).