1

i3 is turning out not to be as simple as the instructions claim. For example the instructions claim I can open an application with partial name. So I tried opening the Chrome browser by typing chrome and that didn't work; I had to type google-chrome for it to work. Now I am trying to open Android Studio but nothing I try works so far. I have tried typing studio, android-studio, jetbrains-studio -- nothing.

Does anyone know a simple way to get opening applications to work? I mean, opening applications is among the most relevant tasks and it's proving too difficult.

salyela
  • 133
  • How is it related to Ubuntu? – Pilot6 Mar 11 '19 at 17:19
  • This is all happening in Ubuntu – salyela Mar 11 '19 at 17:44
  • How did you installed Android Studio? – Kulfy Mar 11 '19 at 18:31
  • See this answer: https://askubuntu.com/questions/634082/how-to-install-android-studio-on-ubuntu . Make sure the location of the adroid studio executable (studio.sh in the answer) is added to the PATH variable, if it's not dmenu ( the launcher in i3) won't "look" in the right place for it. To do this, add to .bashrc or .profile in your home folder: export PATH=$PATH:/path/to/directory/of/executable. – jeroen Mar 11 '19 at 18:44
  • Thanks for the tip. I open vim ~/.profile and as the last line I added: export PATH=$PATH:/usr/more_path/android.sh. Then I restarted i3 and it still doesn't work if I search for android in dmenu. And yes I get the location of android studion by doing whereis android – salyela Mar 11 '19 at 20:20
  • Does ./android.sh in the terminal in the directory /usr/more_path/ work? Is android.sh executable? (If not (sudo) chmod +x android.sh) And as Kulfy asked, how did you install Android Studio Exactly? – jeroen Mar 12 '19 at 20:34
  • The following starts android studio in the terminal: $ /opt/android-studio-3.0/bin/studio.sh but no matter what I do I cannot get it to start from dmenu. I cannot settle for the terminal avenue because then I would always need to have a terminal window open just so I can have Android Studio running. – salyela Mar 13 '19 at 01:18
  • also, I installed from terminal. My Android Studio works fine. I am just now switching from Cinnamon to i3 and that's the whole of my issue: how do I open studio through dmenu? – salyela Mar 13 '19 at 01:28
  • Ok, what is the output of echo $PATH and which version of Ubuntu are you using? – jeroen Mar 13 '19 at 09:17
  • Furtermore, you shouldn't add an executable to PATH but the path to the directory the executable is in. So e.g. add /opt/android-studio-3.0/bin/ to PATH, without studio.sh. – jeroen Mar 13 '19 at 19:41
  • echo $PATH reveals that /opt/android-studio-3.0/bin/studio.sh is part of the path. Re "you shouldn't add an executable to PATH", are you saying my path should simply have /opt/android-studio-3.0/bin/ and that should do it? – salyela Mar 13 '19 at 19:44
  • Yes to your last question. – jeroen Mar 13 '19 at 20:32
  • So it turns out the path gets added only when I add it to .bashrc. After I add it I restart and then verify that echo $PATH returns properly. But then I still cannot open studio from the dmenu. – salyela Mar 14 '19 at 02:02
  • Well, did some research. Installed Ubuntu18.04 in a vm, chose the budgie desktop and installed android studio via the steps in the link I shared earlier. Android Studio works nicely. After having done this I installed i3. I added the directory I installed android studio in to PATH in /home/me/.profile, rebooted the system, chose i3 in the dm, typed studio.sh in dmenu, dmenu found it immediately, I hit enter and Android Studio started as it should. I cannot reproduce your issue. I have no solution for you. – jeroen Mar 14 '19 at 20:33

1 Answers1

0

I had the same issue and solved it by adding the following line to my .bashrc

export PATH="/usr/local/android-studio/bin:$PATH"

NOTE

  • /usr/local/android-studio/bin is the directory that has studio.sh on my machine. I followed the official install instructions. The directory may be different for you.
  • For some reason this wouldn't work when I had put $PATH at the beginning, so if it's not working for you then try putting $PATH at the end of the string like I did here.
  • Remeber to reboot