i3wm dmenu add .desktop file

13,702

Solution 1

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.

Solution 2

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.

Share:
13,702

Related videos on Youtube

AlKappa
Author by

AlKappa

Updated on September 18, 2022

Comments

  • AlKappa
    AlKappa almost 2 years

    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'
      Gilles 'SO- stop being evil' about 7 years
      Is the file owned by root? (I don't know if it matters or not.)
    • AlKappa
      AlKappa about 7 years
      Yes it is: -rw-r--r-- 1 root root 265 Mai 21 13:23 android-studio.desktop Like all other .desktop files.
  • Adaephon
    Adaephon about 7 years
    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).