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?

2

1 Answer 1

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)

2
  • still it's terminal window specific, because the icon itself launches a dialog box for the password. But I think it can be disabled by disabling feedback. I wonder if no terminal is opened it will work! Mar 12, 2014 at 9:11
  • I am not that familiar with plasma, but a "regular" .desktopfile runs this script without a terminal window. I was thinking, you could work around the safety issue to locate the script on a tiny truecrypt volume on a stick or so. Mar 12, 2014 at 9:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .