雷鸟在我家里乱扔东西
雷鸟在我家里乱扔东西 2026年6月4日 | 1分钟阅读 | 289字 | 234.06 kB 我最近重新发现了雷鸟,但它出现了一个错误,显然是因为最近的XDG更改增加了新类型的项目目录。这个错误意味着每次我启动雷鸟时,它都会创建一个目录 ~/thunderbird。我想我应该高兴它是小写的。这个目录毫无用处。它保持空白,而雷鸟已经使用旧式的 ~/.thunderbird 进行配置和数据,而不是在标准的 ~/.config/ 和 ~/.local/share/ 下。我没有时间去掌握修复这个错误的知识。但是,...针对那些在我的主目录中创建目录的应用程序,无论是故意还是无意,我认为这是不礼貌和考虑不周的,因此这不能就这样算了。在这篇文章的其余部分,我将使用 fish(1) shell 以及 systemd(1),所以如果你使用不同的工具,请相应调整。 ~/.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 上面的代码会监控我的主目录。每当创建一个名为“thunderbird”的目录时,它会立即被删除。但是我不想手动运行它并且总是保持一个打开的终端,因此我创建了一个systemd用户服务: ~/.config/systemd/user/watch-thunderbird-dir.service: [Unit] Description=监视并删除thunderbird目录 After=network.target [Service] Type=simple ExecStart=/home/me/.local/bin/watch-thunderbird-dir.fish Restart=always RestartSec=2 [Install] WantedBy=default.target Systemd用户服务需要绝对路径,所以用你的用户名替换“me”,然后启动并启用服务: $ chmod +x ~/.local/bin/watch-thunderbird-dir.fish $ systemctl --user daemon-reload $ systemctl --user enable --now watch-thunderbird-dir.service 如果我们不忘记在雷鸟找到时间解决实际错误后删除所有这些,以上描述的黑客方式将很好用。
本站免费、广告极少。如果觉得有帮助,可以请我们喝杯咖啡 —— 任何金额都对持续运营有实际帮助。
☕请我喝杯咖啡