pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
232 stars 48 forks source link

Launcher should find Text Editor windows with keyword "text" #167

Open adeverteuil opened 1 year ago

adeverteuil commented 1 year ago

Distribution (run cat /etc/os-release):

NAME="Pop!_OS"
VERSION="22.04 LTS"

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

pop-launcher:
  Installed: 1.2.2~1673478272~22.04~643e39b
  Candidate: 1.2.2~1674252928~22.04~1fa817f
  Version table:
     1.2.2~1674252928~22.04~1fa817f 1001
       1001 http://apt.pop-os.org/release jammy/main amd64 Packages
 *** 1.2.2~1673478272~22.04~643e39b 100
        100 /var/lib/dpkg/status

Issue/Bug Description:

When Gnome Text Editor is already open, the launcher doesn't find the existing opened window by keywords "text editor" or substrings. It only detects windows by opened document name, or "Untitled Document". I would like to easily jump back to an existing Text Editor window by typing "text" in the launcher. As a consequence of this behavior, I often end up with multiple open Text Editor windows instead of finding an existing open window and opening a new tab.

Steps to reproduce (if you know):

  1. Open a text editor with a blank document.
  2. Open the Launcher.
  3. Type "text".
  4. The launcher doesn't find the open Text Editor window, but offers to launch a new instance.

Expected behavior:

Typing "text" in the launcher while a Text Editor window is open should suggest sending the focus to that window first, and opening a new window second.

Screenshots:

Typing "text" in the Launcher: Screenshot 2023-01-25 20-45-48 launcher text

Typing "document" in the Launcher: Screenshot 2023-01-25 20-47-38 launcher document

canadaduane commented 1 year ago

After poking around a bit, I think I understand what's going on here: it turns out the word "text" is a common keyword for many apps, and as a result, there are more than 8 apps being returned here. Since a maximum of 8 apps are considered for the match, the window is dropped as a candidate, and only the "open (new) app" option remains.

SRNissen commented 11 months ago

@canadaduane before I create a new issue then, is my specific problem just more of this same thing?

I have installed KolourPaint, but string "paint" doesn't find it:

image

Meanwhile the single letter 'k' finds it directly.

If so, it might be beneficial for both me and the original issue to change the underlying algorithm (...or introduce yet another customization point) such that it prioritizes applications where the search string is in the name before other applications.

canadaduane commented 11 months ago

@SRNissen I don't believe your issue is the same. When I grep for "text" in my installed applications directories, I get several hits:

$ grep -inrEl '(keywords|categories|comment|genericname).*\btext' /usr/share/applications/ /usr/local/share/applications/ /usr/share/xsessions/ /var/lib/flatpak/exports/share/applications/ ~/.local/share/applications/ ~/.config/autostart/ ~/.local/share/flatpak/exports/share/applications/

/usr/share/applications/vim.desktop
/usr/share/applications/gnome-universal-access-panel.desktop
/usr/share/applications/codium-url-handler.desktop
/usr/share/applications/libreoffice-writer.desktop
/usr/share/applications/codium.desktop
/usr/share/applications/org.gnome.gedit.desktop
/home/duane/.local/share/applications/blender.desktop
/home/duane/.local/share/applications/codium.desktop

Whereas with a search for "paint" in place of "text", I only get 1 result (blender). Unless you have many paint apps installed, it would seem this is caused by something other than the "only consider 8" rule I mentioned above.

Update: @SRNissen it looks like it may (?) be caused by KolourPaint lacking a "Keywords" entry in its .desktop file:

$ cp ~/.local/share/flatpak/exports/share/applications/org.kde.kolourpaint.desktop ~/.local/share/applications/org.kde.kolourpaint.desktop
$ echo "Keywords=draw;drawing;paint;painting;graphics;raster;2d;" >>~/.local/share/applications/org.kde.kolourpaint.desktop

Prior to this change, I get no result for "paint" in the launcher (well, I do get "Pinta" which is another paint app); however, after adding Keywords, I do get KolourPaint as the top result.

SRNissen commented 11 months ago

Interesting.

I'm not (Yet! Growth mindset!) skilled enough in Linux dev customs to know if I need to file that as an issue with KolourPaint or with somebody else, do you know?

canadaduane commented 11 months ago

I'm not (Yet! Growth mindset!) skilled enough in Linux dev customs to know if I need to file that as an issue with KolourPaint or with somebody else, do you know?

Did you install it via flatpak (Flathub)? If so, you can visit the page at https://flathub.org/apps/org.kde.kolourpaint. I see "KDE" is the author there, and clicking the link sends me to https://invent.kde.org/teams/flathub. I think you can file an issue there.

Also, kudos for trying to help make things better! I admire that.