The20
Edit:
Oh, by the way, is there a possibility to run scripts that need elevated rights (sudo) by double-clicking them?
Yes, but it's considered a security risk to do so.
Normally, you should run a script or program with "gksudo" or "kdesudo". They have the same effect as "sudo" but give you a popup dialog.
You
can run these commands on a script:
sudo chown root: scriptname.sh
sudo chmod u+s scriptname.sh
sudo chmod a+rx scriptname.sh
This (second command) sets the "sticky user" bit on the file permissions, so that when the file is executed (allowed by the third command) by an unprivileged user, it "sticks" to the permissions of the owner (first command) of the file.
This is how programs like sudo are able to temporarily give you root privileges. They're "sticky" as root, and then when they run the command they're given, the command is executed with an "effective" user ID of 0 or "root".
Again, it's a huge security problem because there's nothing keeping evil persons from taking advantage of it.
A better approach would be to edit your sudoers file:
sudo visudo
(This basically runs "vim /etc/sudoers" as root, but with a special secure configuration.)
Go down to the bottom of the file (you can press shift-G or use the arrow keys or the 'j' key to scroll down) then press 'o' to edit a new line and then add this line:
%admin ALL=NOPASSWD: /usr/bin/scriptname.sh
(Or, instead of %admin, your username. See "man sudoers" for syntax details.)
Press escape, then ZZ (or :wq) to save and quit. Then, the next time you type:
sudo scriptname.sh
it won't prompt for a password for this specific command.
Of course, this assumes you've given the script execute permissions and have given it the owner root with sane permissions: 0555
But I thought the logout dialog had a "shutdown now" button on it?