Disable ~/Desktop folder creation

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
lunario

Disable ~/Desktop folder creation

Unread post by lunario » 2020-06-24, 07:44

I do not use any standard folders like ~/Desktop, ~/Videos, ~/Downloads etc. on my linux system, so I don't want them in my home directory. I disabled all of them in the xdg default settings, but ~/Desktop keeps being created whenever i launch palemoon. Even when I disable all extensions it creates ~/Desktop upon launching the browser, so it is not related to any extensions as far as I can tell.
Is there some way to disable its creation? It must be related to the palemoon settings somehow. (obviously , i already set the download folder to ~/ so that's not what is causing the problem.).

User avatar
Isengrim
Board Warrior
Board Warrior
Posts: 1325
Joined: 2015-09-08, 22:54
Location: 127.0.0.1

Re: Disable ~/Desktop folder creation

Unread post by Isengrim » 2020-06-24, 10:16

This was previously reported here: Issue #1220 (UXP)

Edit: Also found this bug, which may be applicable. What do you have XDG_DESKTOP_DIR set to, and what happens if you append a slash to the end of that value, e.g. XDG_DESKTOP_DIR="$HOME/" ?
a.k.a. Ascrod
Linux Mint 19.3 Cinnamon (64-bit), Debian Bullseye (64-bit), Windows 7 (64-bit)
"As long as there is someone who will appreciate the work involved in the creation, the effort is time well spent." ~ Tetsuzou Kamadani, Cave Story

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35648
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Disable ~/Desktop folder creation

Unread post by Moonchild » 2020-06-24, 15:19

I looked into it a bit more and it seems it's a case of "you can't have the cake and eat it too". The Red Hat sourced by-specification xdg_user_dir_lookup specifically looks for $HOME/ to determine if a path is relative, and if so flags it as relative and strips $HOME/ from it. That works for all relative paths using $HOME as a prefix, except $HOME without a slash - which results in an absolute treatment, which fails, and then our surrounding code falls back to $HOME/Desktop (mostly for historical reasons).
If we'd remove the fallback, it would fail on older systems in a more severe way; if we'd change the behavior of xdg_user_dir_lookup then it would behave differently in all other situations which would be worse too.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

New Tobin Paradigm

Re: Disable ~/Desktop folder creation

Unread post by New Tobin Paradigm » 2020-06-24, 15:27

tl;dr The previous discussion and decision stands.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: Disable ~/Desktop folder creation

Unread post by coffeebreak » 2020-06-24, 15:50

Perhaps this thread will help the OP: Palemoon creates a ~/Desktop directory when started.
(strategies offered to prevent /Desktop creation are in the bottom half, starting here)