Linux - any way to make a desktop icon for a sudo command?

Joined
Sep 30, 2008
Messages
3
Reaction score
0
Hi folks, i've been following the how-tos in the bluetooth forum and am now happily using my phone as a 3G modem. One slight problem is, I need to be superuser to open the dialler program, which means opening the terminal and typing in 'sudo gnome-ppp'

Now this isn't too much of a hassle, but is there a way I could put this into a script, so I could make an icon on the desktop shortcut to it, without needing to type in my su password each time?

I don't want the command to run at bootup because at home I use wifi rather than 3G and don't want the window popping up when not needed.

Thanks
Jon
 
If you already know how to make an icon, then you ought to be able to just have exec=sudo gnome-ppp in the .desktop file. I have a sudo thunar icon in a similar vein. Mind you, there could be some deep linux reason why it would work for thunar but not your prog.

Incidentally, if you want to get really complicated, it is possible to write a script that detects if wifi is connected or not, and executes commands accordingly. In theory you could have one to check for wifi connection and then launch 3g if you're not at home. Some details here, if you'd like to spend a lot of your time to save one click.
 
One slight problem is, I need to be superuser to open the dialler program, which means opening the terminal and typing in 'sudo gnome-ppp'

You can solve this by adding yourself to the group 'dialout'.
( Not sure about this groupname )

A command like

usermod -aG dialout user

should add the user 'user' to the group dialout.

It works only after logging out and in again.

--Japser.
 
You need to open up the file /home/user/.config/xfce4/desktop/group-app.xml

Then add this line to the group that you want to add the Gnome PPP icon to (mine is in Connect).
Code:
<app sequence="3">/usr/share/applications/fedora-gnome-ppp.desktop</app>

This will add the Gnome PPP icon to your desktop. You may have to change the sequence number (3 in my case) if you get icons overlapping on the desktop.

I've not got Gnome PPP to connect to my mobile without running as root so if you find out how let me know!
 
Back
Top