Baloo (简体中文)

From ArchWiki

Tango-preferences-desktop-locale.png本文或本节需要翻译。要贡献翻译,请访问简体中文翻译团队Tango-preferences-desktop-locale.png

附注: Partial translation started 2022-04-23, no updates since.(在 Talk:Baloo (简体中文)# 中讨论)
翻译状态:本文是 Baloo翻译。上次翻译日期:2022-04-23。如果英文版本有所更改,则您可以帮助同步翻译。

BalooKDE Plasma 的文件索引与搜索框架。

安装

安装 baloo 软件包。

用法与配置

为了在 Plasma 桌面上使用 Baloo 进行搜索,启动 krunner (默认快捷键 ALT+F2)并键入查询。若要在 Dophin(文件管理器)内搜索,按CTRL+F

在默认情况下,桌面搜索的 KCM 仅显示两个选项:一个将文件夹放入黑名单的面板以及一种一次点击来禁用它的方法。

或者您可以编辑 ~/.config/baloofilerc 文件[1]。另外您也可以使用 balooctl 进程。运行 balooctl stopbalooctl disable

将文件夹添加到黑名单或完全禁用了Baloo之后,baloo_file_cleaner 进程将会自动删除所有不需要的索引文件。这些文件存储于 ~/.local/share/baloo/ 目录下。

命令行用法

$ baloosearch query

Support for range queries:

$ baloosearch "width>=6000 width<7000"

Groups and OR/AND operators:

$ baloosearch "tag:coolpicture OR (width>=6000 width<7000)"

For a list of all supported filter properties available, see (info).

Note that text search index breaks down all metadata (including filenames) into "words", and does all its searches over it from the beginning of the word only. What this means is that while baloosearch "tutorial" would match my_great_tutorial.txt, baloosearch "utorial" would not match it. To see what "words" baloo stored in the index for a particular file do:

$ balooshow -x filename

索引可移动设备或远程设备

默认情况下,所有可移动设备都在黑名单内,只需在 KCM 面板中将其移除即可。

禁用索引器

To disable the Baloo file indexer:

$ balooctl suspend
$ balooctl disable

The indexer will be disabled on next login.

Alternatively, disable Enable File Search in System settings under Search > File search.

To permanently delete the index database, run:

$ balooctl purge

This will also resolve the following error message in file dialogs and other applications (KDE bug 437176):

kf.kio.core: "Could not enter folder tags:/."

疑难解答

Inotify folder watch limit error

If you get the following error:

KDE Baloo Filewatch service reached the inotify folder watch limit. File changes may be ignored.

Then you will need to increase the inotify folder watch limit:

# echo 524288 > /proc/sys/fs/inotify/max_user_watches

To make changes permanent, create a sysctl configuration file:

/etc/sysctl.d/40-max-user-watches.conf
fs.inotify.max_user_watches=524288

Plasma Vault Files are indexed and available even when vault is closed

This is a major security bug not yet fixed. Any file inside vault is by default indexed and available through file manager search, Krunner and Kickoff.

One workaround is to stop folder(s) from being indexed by Baloo. The relevant options are available in System Settings > Search > File Search > Folder specific configuration > Add folder configuration > Stop indexing a folder. After adding the desired folder, the existing Baloo data needs to be removed and freshly indexed again:

$ balooctl disable
$ balooctl purge
$ balooctl enable
$ balooctl check