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/phpstorm.sh" %f

And update with

Exec=gksudo -k -u <user> "/home/user/Desktop/PhpStorm/bin/phpstorm.sh" %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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s