How to enable global menu for PhpStorm in 13.10

I've installed PhpStorm in /opt/phpstorm and after first run there is file ~./local/share/applications/jetbrains-phpstorm.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Icon=/opt/phpstorm/bin/webide.png
Exec="/opt/phpstorm/bin/phpstorm.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-phpstorm

I've tried with Exec=env UBUNTU_MENUPROXY=1 /opt/phpstorm/bin/phpstorm.sh but that doesn't work.

So, my question is how to move menu bar (File, edit, etc) from PhpStorm window to the top bar as seen in other applications in order to get more working space and better system integration? I think this is also issue with other Jetbrains products like WebStorm, Idea, etc.


Solution 1:

Simply install the "jayatana" package and restart the system.

sudo add-apt-repository ppa:danjaredg/jayatana
sudo apt-get update
sudo apt-get install jayatana

You will also need to enable the "GTK+" theme in PHPStorm (File -> Settings -> Appearance), otherwise I don't think it will work.

Source

Solution 2:

From Ubuntu 15 jayantana is installed by default but the global menu is disabled by default. Because jayantana crashes some java swing packages, if it doesn't you can activate globally or per application base.

  1. Globally

Create a file called jayatana.conf in /usr/share/upstart/sessions/ location and fill it with following data

description "Java Ayatana"

start on starting dbus

script
 initctl set-env --global JAVA_TOOL_OPTIONS="-javaagent:/usr/share/java/jayatanaag.jar $JAVA_TOOL_OPTIONS"
end script
  1. Per application

Add this line at the bottom of your application startup script

JAVA_TOOL_OPTIONS="-javaagent:/usr/share/java/jayatanaag.jar $JAVA_TOOL_OPTIONS"

Solution 3:

You might also need to modify vmoptions file for your IDE. Here you will find instructions for various Java apps, including, specifically, Intellij IDEA and Android Studio: http://www.javahelps.com/2015/06/global-menu-support-for-java.html. Notice though that for PhpStorm the vmoptions file is called "phpstorm.vmoptions". This page helped me to get it working (merely adding jayatana package was not enough on my 15.10)