雷鸟在我家乱扔垃圾
Thunderbird Littering My Home

原始链接: https://thefoggiest.dev/2026/06/04/thunderbird-littering-my-home

作者发现 Thunderbird 存在一个漏洞,即每次启动程序时都会在用户的主目录下强制创建一个不必要的空文件夹 `~/thunderbird`。由于无法忍受这种“不礼貌”的行为,且没有时间深究其根本原因,作者采取了一种自动化的权宜之计。 为解决此问题,作者编写了一个 fish shell 脚本,利用 `inotifywait` 监控主目录,一旦发现 `thunderbird` 文件夹便立即将其删除。为了确保脚本能在后台持续运行,作者将其封装为一个 systemd 用户服务。该服务启用后会自动检测并移除该目录,从而在官方修复该漏洞前保持主目录的整洁。

最近的一场 Hacker News 讨论凸显了用户对于软件在用户主目录下“随意堆放”不必要文件和文件夹的沮丧感,重点讨论了 Thunderbird 会创建一个 `~/thunderbird` 目录的缺陷。 用户们表达了对那些忽视 Linux XDG 标准的应用程序长期以来的不满。根据 XDG 标准,配置文件和缓存文件应该隐藏起来,或存放在专门的目录下,而不是直接放在主文件夹的根目录下。该讨论帖成为了故障排查的中心,参与者们探讨了多种变通方案: * **技术性变通方案:** 一些人建议使用 `systemd` 路径单元或 `inotify` 工具来自动删除这些不需要的目录,但也有人警告称,自动删除脚本存在风险,可能会导致意外的数据丢失。 * **预防性策略:** 用户讨论了通过创建一个同名的空文件来“锁定”文件夹,从而阻止应用程序创建目录,或者为主文件夹设置限制性的权限。 * **替代方案:** 不满的用户推荐了 Betterbird、Evolution 或基于 Web 的邮件客户端等替代品。 这场讨论突显了 Linux 桌面计算中更广泛的矛盾:用户对整洁、有序环境的追求,与现代应用程序日益“凌乱”的行为之间的冲突。
相关文章

原文

June 04, 2026 | 1 minute read | 289 words | 234.06 kB

I’ve recently rediscovered Thunderbird, but it has developed a bug, apparently because of recent XDG changes which added a new type of projects directory. The bug means that any time I start Thunderbird, it creates a directory ~/thunderbird.

I suppose I should be glad it’s in lowercase I suppose I should be glad it’s in lowercase

The directory is useless. It remains empty, and Thunderbird already uses an old-style ~/.thunderbird for configuration and data, instead of respectively under the standard ~/.config/ and ~/.local/share/.

I don’t have the time to build the knowledge to fix this bug. I am, however, on record for finding applications that make directories in my home, intended or not, impolite and inconsiderate, so this will not stand.

In the rest of this post I will use the fish(1) shell as well as systemd(1), so if you use different tools, adjust as needed.

~/.local/bin/watch-thunderbird-dir.fish:


#!/usr/bin/fish
inotifywait -m -e create ~/. | while read FILE
  echo $FILE
  if test -d 'thunderbird';
    rmdir 'thunderbird';
  end
end

The above will watch my home directory. Whenever a directory called “thunderbird“ is created, it is immediately removed. But I don’t want to run it by hand and have an open terminal all the time, so I create a systemd user service:

~/.config/systemd/user/watch-thunderbird-dir.service:


[Unit]
Description=Watch and remove thunderbird directory
After=network.target

[Service]
Type=simple
ExecStart=/home/me/.local/bin/watch-thunderbird-dir.fish
Restart=always
RestartSec=2

[Install]
WantedBy=default.target

Systemd user services need absolute paths, so adjust “me” with your username and start and enable the service:


$ chmod +x ~/.local/bin/watch-thunderbird-dir.fish
$ systemctl --user daemon-reload
$ systemctl --user enable --now watch-thunderbird-dir.service

If we don’t forget to remove all this once Thunderbird have found time to solve the actual bug, the hack described here will do nicely.

联系我们 contact @ memedata.com