10

I wanted to add Android studio to the i3dmenu in: /usr/share/applications with the file android-studio.desktop containing:

[Desktop Entry]
Version=1.0
Type=Application
Name=android-studio
Exec="/usr/local/android-studio/bin/studio.sh" %f
Icon=/usr/local/android-studio/bin/studio.png
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-studio

Can somebody tell me why the i3-dmenu still doesn't find android-studio?

I can confirm that the file is readable for everybody.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
AlKappa
  • 151
  • 1
  • 1
  • 5

2 Answers2

5

For the sake of completeness, i3-dmenu-desktop is searching for every binary in $PATH and for .desktop files in $XDG_DATA_HOME/applications[...]. Problem was, the $XDG_DATA_HOME variable was not set in my environment.

AlKappa
  • 151
  • 1
  • 1
  • 5
  • 1
    if `XDG_DATA_HOME` is not set, it defaults to `$HOME/.local/share`. `i3-dmenu-desktop` also searches any `applications` subdirectories of directories listed in `XDG_DATA_DIRS`, which defaults to `/usr/local/share:/usr/share`, if unset. (Hence `/usr/share/applications`). – Adaephon Jun 16 '17 at 09:56
3

dmenu can find applications in /usr/bin or /bin/

So you can just create a symbolic link to the path of studio.sh, which would be

sudo ln -s /usr/local/android-studio/bin/studio.sh /usr/bin/android-studio

in your case.

Now you can search for android-studio in dmenu to launch it.

Amith
  • 231
  • 1
  • 2
  • 8