Launching Android Studio

Hi, I’ve recently changed from gnome-shell to swaywm and I cant launch android-studio from the menu. If I open a terminal I can launch android-studio just fine, but not from mod+d menu

Any thoughts ?

Thanks

p.s Love EndeavourOS :wink:

just installed it but i have no idea how to use it. It does launch from the terminal and from mod+d. I’m just not sure what to do with it? :smile: I’ve never used it before.

I’ve used it in the past, but only for creating virtual phones to run apps on; basically an Android VM. It’s basically an Android-only subset of Jetbrain’s IntelliJ IDEA IDE.

What does the menu item contain? From my previous install, all the exec line shows is android-studio %f.

It just comes up like this.

Screenshot_20220222_220629

Edit: I just tried in on vmware to see if it would launch.

Edit: I’m installing the git version to see.

Edit3: Don’t think there’s enough space so it failed to install. :thinking:

@JCC
I see what you mean. Maybe someone from the community editions can help you. I don’t think it’s launching the terminal along with it when running it from mod+d menu or some other issue. It does seem to work from the terminal. I really wouldn’t know how to use it. :man_shrugging:

Welcome to forum @JCC ! :rocket: :enos_flag:

Java applets may have issues with Sway.

See this section from SwayWM wiki :

Basically, you append this to your ~/.profile

if [ "$XDG_SESSION_DESKTOP" = "sway" ] ; then
    export _JAVA_AWT_WM_NONREPARENTING=1
fi

Relevant issue :


@ricklinux if you haven’t deleted that VM, could you try running android studio with this command :

QT_QPA_PLATFORM=xcb _JAVA_AWT_WM_NONREPARENTING=1 android-studio
2 Likes

Thanks for the welcome @flyingcakes

I tried your suggestion and no luck. Not a big drama as i’m using vscode as my main application, just using android-studio to create the emulator.

The other question therefore would be how to configure in the sway config for the emulator to float ?

Something like

for_window [app_id="XYZ"] floating enable

in your config should do the trick. But I don’t know how you would get those id. If you can match on name, then trying for Android Emulator * should work.

@OdiousImp Roping you in. I don’t know if you can get id that is same everytime application is launched. Android emulator seems to get a numeric id. Name always starts with Android Emulator though.

1 Like

Welcome to the forum @JCC :enos: :enos_flag: :partying_face: :tada:

2 Likes

@JCC

To get only the app_id's of all open windows use:

$ swaymsg -t get_tree | grep "app_id"

To get the app_id of the focused window use:

$ swaymsg -t get_tree | jq -r '..|try select(.focused == true)'

The add this into your config. There’s some examples that are done for other applications in ~/.config/sway/config.d/application_defaults

`for_window [app_id="XYZ"] floating enable`

@OdiousImp Thanks for the advice. I gave up on Sway in the end and went back to Gnome-Shell with the Material-Shell extension installed :wink:

1 Like