Hello,
I am running Nextcloud 26 on my own server. I wanted to modify the setting of “Show Hidden Files” to be marked in the Files settings of files app. Is it possible by changing config file or any other source file where it can be modified?
Hello,
I am running Nextcloud 26 on my own server. I wanted to modify the setting of “Show Hidden Files” to be marked in the Files settings of files app. Is it possible by changing config file or any other source file where it can be modified?
Are you saying you’d like the file settings “show hidden files” to be enabled by default, like in the screenshot below? I think this is a per-user setting that persists if the user enables it. I don’t know how to change the default for all users.
Yes, I want to enable it by default. User may change the setting but for any new user, it should be marked checked by default.
Interesting. Not sure why you’d want to do that, but I think the place to look is the occ command line tool which can be used to globally change settings for users. I came across an example you could follow: Profile configuration — Nextcloud latest Administration Manual latest documentation.
That said, I grepped the list of settings displayed using occ config:list
and was not able to find one related to the showing of hidden files. Maybe you can figure out what the setting is called and add it using the occ command? I am not very familiar but would be interested to learn more about how this works.
I checked those links already but didn’t get any custom setting for hidden files. This might be possible through the source file of that particular page but I can’t see where it is located.
It’s available as a per-user setting that can be modified via occ
:
@TobiasEigen has the right idea:
It can be modified via occ user:setting
. The parameter is show_hidden
.
There isn’t a global system setting to change it globally, but it would be totally possible to set it when provisioning a new user or automate iterating through the user list and setting it in a shell script running via cron periodically.
Here’s how it would be done manually (which you can adapt to a script or whatever your provisioning process is):
# confirm it's not already enabled
www-data@564eb1fd365d:~/html$ ./occ user:setting josh files
- files:
- file_sorting: mtime
- file_sorting_direction: desc
- quota: none
- show_grid: 0
- settings:
- display_name: Josh
# enable it
www-data@564eb1fd365d:~/html$ ./occ user:setting josh files show_hidden 1
# confirm it's enabled
www-data@564eb1fd365d:~/html$ ./occ user:setting josh files
- files:
- file_sorting: mtime
- file_sorting_direction: desc
- quota: none
- show_grid: 0
- show_hidden: 1
- settings:
- display_name: Josh
# disable it
www-data@564eb1fd365d:~/html$ ./occ user:setting --delete josh files show_hidden
# confirm it's disabled
www-data@564eb1fd365d:~/html$ ./occ user:setting josh files
- files:
- file_sorting: mtime
- file_sorting_direction: desc
- quota: none
- show_grid: 0
- settings:
- display_name: Josh
Out of curiosity, what is your use case? I tend to turn this setting on personally out of habit, but I don’t run across many environments that need it enabled.
@jtr Thank you for the help. But my requirement was to set it globally. Also, since I have integrated my app with Active Directory, I won’t be able to run the occ settings individually.
Related to the use case, turning on setting by default is user friendly since any normal user won’t check the settings and locate these things. It will be easier for application managers.
I understand you were hoping for a single built-in global flag to toggle. Conventional NC settings remain applicable to LDAP/AD users (including occ
commands). On the global front, it’s still easily scriptable to do this.
If you’d prefer it be a single built-in global setting or maybe a special attribute passed via LDAP (like quota can be), you can always implement it (and submit a PR!) as a community member and/or sign up for a enterprise service from Nextcloud gmbH if you’d prefer someone else do the implementation.