2

I have a quicklauncher in a plasma widget (which is the same as a shortcut) which runs a command which needs administration privilege. I use the quicklauncher frequently and do not want to type root password each time.

Is there a way to give root privilege to the icon or somehow add the password to the command which is run by the icon?

1 Answers1

2

if you would like to run it without a terminal window, and set the password in the command specifically (without editing sudoers), another option is to create a script like:

#!/bin/bash
echo <password> | sudo -S <command>

-and run it from your launcher (quicklauncher).

The command in the launcher would be:

/bin/bash 'path_to_script.sh'

The downside is that you have your password stored in a file on a risky location. To work around the safety issue, you could locate the scrypt on a small truecrypt volume.

(inpsired by this thread)

Jacob Vlijm
  • 85,475