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

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

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

Hacker News 最新 | 往日 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Thunderbird 在我的主目录下乱放文件 (thefoggiest.dev) 15 分,由 speckx 发布于 58 分钟前 | 隐藏 | 往日 | 收藏 | 2 条评论 | 帮助 lomlobon 23 分钟前 | 下一条 [–] 我早就放弃保持主目录整洁了,因为太多的软件都这样做,想保持干净简直是没完没了的杂活。现在我直接在我的“主目录”里建一个 real_home 文件夹,把我真正需要的东西放进去。 剩下的就留给 ~ 当垃圾场吧。 回复 the__alchemist 10 分钟前 | 上一条 [–] Thunderbird 里烦人的地方太多了。用了几天我就放弃了。我主要担心的问题: - 打开一个邮件主题会弹出多个(有时是很多个)标签页,导致很难浏览或理解消息的脉络。 - 我不知道如何在写邮件时不让段落/行间距变得比我想要的更大(即双倍行距)。 - 搜索功能不可靠/已损坏。 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:
相关文章

原文

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