Monday, April 29, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 5816  / 3 Years ago, thu, may 13, 2021, 6:58:03

How do I create a keyboard shortcut to a script that needs sudo privileges?
I tried to create shortcuts via Ubuntu Keyboard Settings GUI to scripts




"sh script.sh"
"sudo sh script.sh"




They don't work.


More From » shortcut-keys

 Answers
3

sudo requires a terminal to get the password from. Use gksudo instead; it asks for the password via a gui dialog box.



gksudo -- script

[#37917] Friday, May 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emuralm

Total Points: 290
Total Questions: 111
Total Answers: 117

Location: China
Member since Thu, Sep 1, 2022
2 Years ago
;