I switched to Ubuntu so that I could run my webserver on HHVM rather than WAMP. But I'm encountering basic problems that are slowing down my development time significantly. I feel this is probably a simple issue to address, but every post on the internet is "here's how you do this in terminal, and here's why it's the most dangerous thing in the world."
What I'm looking for is pretty simple: I want to load sublime (or gedit, or text editor of choice) and edit files in the /var/www directory WITHOUT having to change the owner, group, or permissions of the /var/www directory. I DON'T want to load my text editor through terminal - I just want to click on the side bar, choose a file, and it works.
I realize that as developers, yes, we can jump through hoops to resolve these problems on an individual basis through the terminal. But I just want to load up the desktop and enter the project without having to worry about loading several new commands when I need to change a virtual directory in /etc/nginx or something.
How can I have a one-click solution to the "privileges denied" issues when trying to locally edit system files / files that are protected for a reason? Bearing in mind I ONLY want to do this locally, thus not wanting to change their protective settings.
Edit: This question is 95% resolved. It would be preferable if Ubuntu Desktop version were slightly more accessible for development purposes for superusers, but the accepted answer by Jacob addresses the main issue and showcases some interesting functionality with Ubuntu.
You could simply make the files accesible via the Unity launcher, adding a link to an icon in the Unity launcher, automatically entering the password via a script. I would however prefer the solution below.
I think the best solution to quickly access and edit password-protected files would be to add (lock) gedit (or any editor of your choice) to the launcher and edit its desktop file, adding a few entries, accesible by right-clicking.
To enter the password you need to install
gksu
first, then:Copy the default
gedit.desktop
file to your local directory:Open the file with gedit (open gedit, go to
~/.local/share/applications
, drop the file on to the gedit window)Paste the following at the end of the file (in this example to open fstab file):
Then look for the line starting with
Actions=
, add the name of your new mention (in this examplefstab
) +;
, so the complete line should look something likeActions=Window;Document;fstab;
After log out and back in, your files are accesible, you only have to enter the password.