How get rid of Desktop, Playlists, Public and Templates in your $HOME?

Hi, long time user here.

I have never ever had any use of directories mentioned in the title, so how can I get rid of them? I really don’t feel like I have a Desktop on my phone, or use Templates, or have anything Public I’d like to share here. And Playlists are handled by Unplayer. Yet here the directories are in my $HOME and taking space in my dialogs and cramping my Tab-completion. Does anyone use these directories, and how?

Another approach would be to rename them via localization strings I guess?

Also, ~/.config/user-dirs.dirs seems to be almost completely ignored now — the new directories are made, but that’s pretty much it. Browser does try; it shows altered Download directory set via XDG_DOWNLOAD_DIR, but fails to write anything there.

Cheers! :slight_smile:

what problem are you trying to fix? they’re just empty standard linux directories they take up 0 space.

just use your favourite file manager or use rmidr, whats so complicated about removing linux directory that it requires entire thread?

2 Likes

Should this be configurable via XDG toolset? You shall be able to find a solution on desktop/laptop machine in man pages.

Remove them and they pop back at the next boot.

The XDG used to work at some point, at least I remember renaming Downloads at some point. The new directories are still generated, but they are not honored. There seems to be another mechanism at play that overrides the XDG-stuff. My guess is that it’s related to Sailjail, but I haven’t dug deeper.

I find it very annoying as well. Same as with Android.

Strange, on normal Linux they are created at user created according to /etc/skel/ not sure about what creates them at every boot but XDG is a suspect and I would also look at systemd-homed and the like.

As for finding the responsible code, try searching Jolla github account for the strings in question.

It seems that no reboot is necessary to recreate the directories.

Steps to duplicate:

  1. remove Desktop directory
  2. launch an app with enforced sandboxing(?)
  3. see Desktop directory pop back by some firejail-thingie

Parts of a log showing the thing in action, tested with sailtrix and whisperfish.

[defaultuser@Xperia10III ~]$ devel-su journalctl SYSLOG_IDENTIFIER=invoker -f
Password:
– Logs begin at Mon 2025-08-25 11:25:50 EEST. –
elo 25 11:36:20 Xperia10III invoker[29482]: warning: enforcing sandboxing for ‘/usr/bin/harbour-sailtrix’
elo 25 11:36:20 Xperia10III invoker[29482]: constructing /run/firejail/mnt/privileged: Images …
elo 25 11:36:20 Xperia10III invoker[29482]: mounting /run/firejail/mnt/privileged @ /home/defaultuser/.local/share/system/privileged
elo 25 11:36:20 Xperia10III invoker[29482]: hiding /run/firejail/mnt/privileged
elo 25 11:42:12 Xperia10III invoker[29917]: warning: enforcing sandboxing for ‘/usr/bin/harbour-whisperfish’
elo 25 11:42:12 Xperia10III invoker[29917]: constructing /run/firejail/mnt/privileged: Images,Contacts …
elo 25 11:42:12 Xperia10III invoker[29917]: mounting /run/firejail/mnt/privileged @ /home/defaultuser/.local/share/system/privileged
elo 25 11:42:12 Xperia10III invoker[29917]: hiding /run/firejail/mnt/privileged

I wonder if this firejail is documented somewhere? Search on https://docs.sailfishos.org/ gives me firewall :stuck_out_tongue:

If it were difficult to get rid of these directories, could you just use them to store whatever one may see fit or is there a risk that whatever keeps recreating them might also edit or delete data?

I don’t think there is a danger of losing data, the directories are just made if they are not found. And yes, I could just use them, but I tend to name directories by the content… :melting_face:

Create a shellscript autostart.sh and execute it on every bootup which command like rmdir /Desktop…etc or make them non-visible for the defaultuser

I wish it would be that easy. When starting sandboxed application, sailjail/firejail recreates the directories.

A possible solution using my spare phone with SFOS 5.0.0.68. Tread carefully if you want to follow along, the following has “it seems to work, but might not” -license. And obviously this is not optimal since things will most likely will be reverted back to default on any updates…

(What really irks me, that there seems to be $XDG_-variables in play, and those directories are also made if you fiddle around with ~/.config/user-dirs.dirs, but they are completely ignored by sailjail. So what is the point?)

So anyway, under /etc/sailjail/permissions/ are a bunch of files. For example for changing Playlists you’d have to edit Base.permissions and Music.permissions. Grep around and you’ll know what to edit. Tail of my Base.permissions looks like this now:

mkdir ${HOME}/.desktop
blacklist ${HOME}/.desktop
mkdir ${HOME}/Documents
blacklist ${HOME}/Documents
mkdir ${HOME}/incoming
blacklist ${HOME}/incoming
mkdir ${HOME}/Pictures
blacklist ${HOME}/Pictures
mkdir ${HOME}/.playlists
blacklist ${HOME}/.playlists
mkdir ${HOME}/Music
blacklist ${HOME}/Music
mkdir ${HOME}/Videos
blacklist ${HOME}/Videos
mkdir ${HOME}/.public
blacklist ${HOME}/.public
mkdir ${HOME}/.templates
blacklist ${HOME}/.templates
[defaultuser@XperiaXA2 permissions]$

All the crap directories are still there, but now hidden. And Downloads I renamed as incoming. My eyes are now at rest and my Tab-key will live a little longer :slightly_smiling_face:

1 Like

It looks like isn’t a Jolla thing: GitHub - netblue30/firejail: Linux namespaces and seccomp-bpf sandbox
And maybe removing both lines; mkdir and blocklist would get rid of the “problem“ :wink:

For what senseful things can the ‘Desktop’ directory be used? Would be fine if content of this folder would appear somewhere like on a real computer.

Just a folder to store links and .desktop files but got superseded by menus and launches a long time ago in my workflow - mostly Krunner. The Problem with the Desktop directory is that it only makes sense if it’s shown as a background or can be quickly presented in an other way.

You all got it right, /etc/skel is used upon user creation. Sandboxing must match to default xdg folders so that data won’t get lost upon app exit. Randomly created folders under $HOME are lost upon app exit.

Hope this helps to understand. We don’t want to reinvent the wheel again.

1 Like

I’m thinking this problem would go away, if variables from ~/.config/user-dirs.dirs would be read back to sailjail. The point of that file is to override what ever directories are set in the system level with the values that the user wants (https://www.freedesktop.org/wiki/Software/xdg-user-dirs/).

But I also realize that this is not a top priority.