philj56 / tofi

Tiny dynamic menu for Wayland
MIT License
904 stars 39 forks source link

[FR] Add a configuration to allow matching filenames of .desktop files #116

Open Mufanc opened 1 year ago

Mufanc commented 1 year ago

Sometimes the name item in a .desktop file will only contain CJK characters, in which case a configuration item that enables tofi to also try to match the filename of the .dekstop file will greatly improve the efficiency of the user's search.

For example, for the following desktop file:

# /usr/share/applications/com.gitee.gmg137.NeteaseCloudMusicGtk4.desktop
[Desktop Entry]
Name=NetEase Cloud Music Gtk4
Name[zh_CN]=网易云音乐
Name[zh_TW]=網易雲音樂
Comment=NetEase Cloud Music Gtk4
Comment[zh_CN]=网易云音乐
Comment[zh_TW]=網易雲音樂
Exec=netease-cloud-music-gtk4
Icon=com.gitee.gmg137.NeteaseCloudMusicGtk4
StartupWMClass=com.gitee.gmg137.NeteaseCloudMusicGtk4
Terminal=false
Type=Application
Categories=GTK;Audio;AudioVideo
StartupNotify=true

Searching using an application name requires three steps:

  1. Switch to the input method
  2. Type wangyiyunyinyue
  3. Then select a matching candidate to enter the application name into the input box.

If it is allowed to search by filenames, you can simply type gmg and the application will be opened.

philj56 commented 11 months ago

Hey, sorry for the slow response. This sounds reasonable, and should be fairly easy to implement. I'll have a look into it

Mufanc commented 11 months ago

No need to apologize. Thanks for the project :)