Live data from Hacker News

Thunderbird Littering My Home

thefoggiest.dev

61–63 of 63 posts

Re: Thunderbird Littering My Home

#61
post #9

You can skip inotify tools altogether and do use systemd like this to trigger `rm -rf`: `~/.config/systemd/user/remove-thunderbird-dir.path` [Unit] Description=Watch for unwanted ~/thunderbird directory [Path] PathExists=%h/thunderbird Unit=remove-thunderbird-dir.service [Install] WantedBy=default.target

So often the answer to "Can systemd just do that?" is "yes." But before AI, it was hard to surface the way to do it. Now I can get a lot done just by asking Claude for a few ways of doing something, and often the systemd answer is there.

For something like this I don't think you need to know much about systemd to figure it out, without AI. I promise it is worth the effort to learn some basics of systemd units. It then becomes easy to learn things like path triggers, timers, mounts, etc because they all follow the same pattern. The annoying (and nice) thing about systemd is that these files are a bit verbose. I'd suggest just dropping a few templates in your dotfiles. I do that (I even did that with cron).

For this file, it's pretty straight forward to read. I'm telling you because I think it'll change your mind.

The file name ends in ".path"[0] (it starts with `~/.config/systemd` so it is a user process with user permissions), meaning it monitors paths. Simple!

Then what matters is what's in `[Path]`. `PathExists` is the path being monitored. `Unit` is what service runs. In this case whatever is in `~/.config/systemd/user/remove-thunderbird-dir.service` but guess what, `Unit` is completely optional here. It will default to that. You can probably guess `%h` means `$HOME`. The `[Install]` is necessary though, but that's going to be common and everywhere.

Cumbersome? Yes. Annoying? Mildly, but it's worth it and just minorly inconvenient. Difficult? No. Powerful? YES

[0] https://www.freedesktop.org/software/systemd/man/latest/syst...

Re: Thunderbird Littering My Home

#62

Earlier quoted context omitted.

So then you have to run those apps as root user, or does sudo to your own user work? I wouldn't expect it to with those perms set. Seems more dangerous than just dealing with the cruft.

I don't launch them as root. That defeats the purpose because they would write on the ~ folder. ZSH Terminal grumbles when launching but why the hell does it want to log my every command? only 1 app has failed to launch and I barely need it anymore. if it is crucial, I give myself permission to edit the folder so the application can create its folder for dumping rubbish

zsh wants to write a history file so you can recall previous commands. You can disable it or set to to write somewhere else
Post reply on HN