albertlauncher / albert

A fast and flexible keyboard launcher
https://albertlauncher.github.io
Other
7.22k stars 303 forks source link

Some shortcuts not opening up #729

Closed BobbyWibowo closed 5 years ago

BobbyWibowo commented 5 years ago

Source

$ apt policy albert
albert:
  Installed: 0.14.22
  Candidate: 0.14.22
  Version table:
 *** 0.14.22 500
        500 http://download.opensuse.org/repositories/home:/manuelschneid3r/xUbuntu_18.04  Packages
        100 /var/lib/dpkg/status

Environment

$ albert --report
        Albert version: v0.14.22
            Build date: Sep 21 2018 16:47:47
            Qt version: 5.11.2
  QT_QPA_PLATFORMTHEME: 
       Binary location: /usr/bin/albert
                   PWD: /home/bobby
                 SHELL: /bin/zsh
                  LANG: C.UTF-8
      XDG_SESSION_TYPE: x11
   XDG_CURRENT_DESKTOP: KDE
       DESKTOP_SESSION: /usr/share/xsessions/plasma
   XDG_SESSION_DESKTOP: KDE
                    OS: KDE neon User Edition 5.14
     OS (type/version): neon/18.04
             Build ABI: x86_64-little_endian-lp64
  Arch (build/current): x86_64/x86_64
 Kernel (type/version): linux/4.15.0-38-generic
KDE neon 5.14
4.15.0-38-generic
DESKTOP_SESSION=/usr/share/xsessions/plasma
XDG_CURRENT_DESKTOP=KDE
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_TYPE=x11
albert v0.14.22

Steps to reproduce

Note: Issue's title is plural (shortcuts) since I've got another shortcut that won't run under Albert, but it does cd too so I'm sure it's the same issue.

Expected behaviour

The application runs.

Actual behaviour

The application doesn't run. I wasn't sure how to debug though. One thing I know, it runs with KDE's KRunner.

ManuelSchneid3r commented 5 years ago

Is this exec line compatible with the standard? I mean is the exec line intended to be interpreted by a shell?

BobbyWibowo commented 5 years ago

I don't even know the standard, to be honest. It would work with KRunner, or just executing the .desktop file directly from Dolphin, so I simply assumed it was meant to be compatible or something.

petersonespacoporto commented 5 years ago

I'm also affected by this, but with one specific app that doesn't have such an unusual .desktop file. Here it is:

[Desktop Entry] Name=4K Video Downloader GenericName=4K Video Downloader Comment=Download online video Exec=4kvideodownloader Terminal=false Type=Application Icon=4kvideodownloader.png Categories=Network;Qt;

It simply won't launch via Albert.

BobbyWibowo commented 5 years ago

It appears to be failing with shortcuts that have this sort of Exec line as well:

Exec=env GTK2_RC_FILES=/usr/share/themes/Arc/gtk-2.0/gtkrc codeblocks %F

Before anybody tells me to, exporting that env var with my bash profile is not an option, as I only wanted to set that theme specifically for the application codeblocks, as the one I used system-wide was "dark-ish" and didn't render well with the application (some items in its interface have forced colors).

BobbyWibowo commented 5 years ago

Oh sorry. It works well this way: Exec=env GTK2_RC_FILES="/usr/share/themes/Arc/gtk-2.0/gtkrc" codeblocks %F. Hmm, I think I'm onto something.

BobbyWibowo commented 5 years ago

Okay, after some looking around, it seems Exec line is supposed to only have 1 executable. So like, what I did by having it run 2 commands (cd then the program) wasn't valid. So I ended up with:

Exec=sh -c "cd /opt/XMind/XMind_amd64 && env GTK2_RC_FILES=/usr/share/themes/Arc/gtk-2.0/gtkrc ./XMind %F"

and it has been working well.

I think @petersonespacoporto should open up a new issue as now it doesn't seem like it will have any relation with my issue. With that said, I think this can be closed.