LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-12-2012, 09:22 PM   #1
fogpipe
Member
 
Registered: Mar 2011
Distribution: Slackware 64 -current,
Posts: 550

Rep: Reputation: 196Reputation: 196
Running sudo from a panel icon


The command
Quote:
sudo pm-suspend
runs fine and puts the computer into sleep mode when run from a command line, but when i try to run it by clicking on a script or on the fbpanel icon i have set up it gives this error in .xsession-errors
Quote:
sudo: no tty present and no askpass program specified
My user is in the sudoers file and there is no require tty option that i can find in /etc/sudoers to comment out.

Does anyone know a way i can do this?
 
Old 05-12-2012, 09:44 PM   #2
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
For the icon, set the command-line to:
Code:
gksudo <scriptname>
 
Old 05-12-2012, 10:06 PM   #3
fogpipe
Member
 
Registered: Mar 2011
Distribution: Slackware 64 -current,
Posts: 550

Original Poster
Rep: Reputation: 196Reputation: 196
Quote:
Originally Posted by towheedm View Post
For the icon, set the command-line to:
Code:
gksudo <scriptname>
That just pops up a password prompt and appears to be just a graphical frontend to sudo. sudo is already out of the way, at least as far as a password is concerned, since the user calling the script is in the /etc/sudoers file with appropriate permissions to run the program in question. The idea is for the user to be able to click on an icon and put the computer into sleep mode without further interaction or opening a command line.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] mixer icon missing in right panel rbixler1957 Mandriva 1 06-10-2011 02:21 PM
openSUSE 11.4 - wired icon does not change to wireless icon in panel rusty2 Linux - Software 1 04-14-2011 04:46 AM
[SOLVED] Can't add icon to panel emoore Linux - Newbie 2 08-02-2009 05:34 AM
[SOLVED] gnome-panel icon refresh yo8rxp Ubuntu 2 07-12-2009 07:10 AM
Add icon at Panel chinaundead Mandriva 2 03-10-2004 09:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration