PhpStorm in a teacup

There is nothing more annoying in IT – but I’m sure there is – as having to do something manually that you know can be automated. A case in point is opening up PhpStorm as some one else in order to edit files which do not belong to you. The problem is that you have to go into command line mode to to this. This is my storm in a tea cup!

The problem: how to launch PhpStorm on the desktop to edit files not owned by yourself.

Assuming you have already installed PhpStorm.

First you will need to install gksu to use gksudo

sudo apt-get install gksu

And then you will need to edit the PhpStorm desktop launch file. I use the command line application ‘vi’ but you can use any editor.

sudo vi /usr/share/applications/jetbrains-phpstorm.desktop

Edit the line

Exec="/home/user/Desktop/PhpStorm/bin/" %f

And update with

Exec=gksudo -k -u <user> "/home/user/Desktop/PhpStorm/bin/" %f

When you launch PhpStorm from your desktop you will be requested to input the <user> password. You will now be able to edit files not owned by yourself.