0

How can I start and application with root privileges, just once.

For example I need to start SublimeText with sudo privileges, then I write in a console:

$ sudo subl

But, I wonder if there's any way to do this from the dash or side bar.

Something similar to 'Launch as administrator' from Windows.

Gocht
  • 385

2 Answers2

2

In my opinion, one way is to create executable shell script and then using pkexec run Sublime Text. I think that you can move the .sh file to dash then... But I am no longer using Ubuntu, so I am not so sure about this.

  1. Create empty file: touch run-sublime.sh

  2. Edit file using your favorite editor e.g. subl run-sublime.sh

  3. Paste this in file

    #!/bin/bash
    pkexec subl

  4. Make script excutable: chmod +x run-sublime.sh

2

You can create a .destop file with this:

Exec=pkexec subl

in the exec line and move this in the Dash.

and move that to the dash.

Bruni
  • 11,099