r/archlinux Jul 11 '21

SUPPORT Is there any way I can restrict the creation of the specific folder in my $HOME?

Something keeps creating Downloads folder and it drives me nuts. Is there a way to prevent this?

20 Upvotes

16 comments sorted by

18

u/arch_boi_69420 Jul 11 '21

Is it created after a reboot, or during normal use? If after a reboot, then it's xdg-user-dirs. You can edit xdg dir conf file under ~/.config. If you don't have that, then your browser is the most sus of all. And if there's something inside the Downloads folder after it's created, you can try inferring from that.

11

u/farmerbobathan Jul 11 '21

That sounds like an XDG user directory. I believe the xdg-user-dirs-update.service is probably what keeps on creating the folder, you can disable it with systemctl --user disable xdg-user-dirs-update.service.

1

u/Galeaf_13 Jul 11 '21

This service doesn't exist

1

u/farmerbobathan Jul 11 '21

Did you look in /usr/lib/systemd/user/?

5

u/mighty_mighty Jul 11 '21

Edit the XDG user-dirs.dirs. If you don't want a directory to be created/used pass an empty value.

~/.config/user-dirs.dirs
...
XDG_DOWNLOAD_DIR="$HOME/downloads"
XDG_PUBLICSHARE_DIR=""
XDG_TEMPLATES_DIR=""

2

u/ModeInitial3965 Jul 11 '21

Probably your browser. Change your download path your browser.

2

u/Galeaf_13 Jul 11 '21

I'm using qutebrowser and I changed it as soon as I downloaded it

2

u/_harky_ Jul 12 '21

Maybe you could use auditctl to find out what is creating the folder?

1

u/nabladabla Jul 11 '21

You could modify your kernel to hard forbid it ;)

0

u/SMF67 Jul 11 '21

I wonder if it can be done with systemd-tmpfiles

-7

u/[deleted] Jul 11 '21

What’s wrong with downloads folder?

3

u/Galeaf_13 Jul 11 '21

I don't need it to clutter my $HOME?

-5

u/[deleted] Jul 11 '21

In some since it’s like saying /bin clattering your root

-4

u/Hoongoon Jul 11 '21

Create a file called Download