PDA

View Full Version : adding application to system menue


tnbt
12-28-2006, 07:21 PM
Hi,

I just tried to add the vpnc-applicationt to the system menu. what I did is this:

* create a file /usr/share/applications/hildon/vpn-connect.desktop:
[Desktop Entry]
Encoding=UTF-8
Version=0.3.3
Type=Application
Name=vpn-connect
Exec=/usr/bin/vpn-connect.sh
Icon=terminal
X-Osso-Service=vpn-connect
MimeType=application/x-executable

The file has the following link:
/etc/others-menu/extra_applications/0200_vpn-connect.desktop

Next I created a dbus file called /usr/share/dbus-1/services/vpn-connect.service:

[D-BUS Service]
Name=vpn-connect
Exec=/usr/bin/vpn-connect.sh

After that I can see the new menu item, but when I click on it, nothing happens. When I call the script (/usr/bin/vpn-connect.sh) manually, everything works as expected.

anybody knows what the heck is going wrong?!

Thanks.

SeRi@lDiE
12-28-2006, 08:17 PM
When you call on the script from xterm are you as root or user?

tnbt
12-28-2006, 08:22 PM
I call the script as user and there is an sudoers entry as well.

SeRi@lDiE
12-28-2006, 08:28 PM
So you are using sudo to call it?

sudo vpn-connect.sh

It could be that the file needs root privilages I have the same issue with NmapFE
Even if you make the link correct wich it looks like it is... the link wont call on the script since it needs root privilages.

SeRi@lDiE
12-28-2006, 08:31 PM
I was looking at some of the VPN solutions at the Application Catalog and it looks like VPN needs root privilages...

From OpenVPN


OpenVPN needs root permissions. Authentication with pam and lzo compression support are currently disabled so that OpenVPN package would not need any additional dependencies.

Updated with -o0 (no more errors on certificates) and no more maemo dependency. So it should work (it works for me, using my Maemo-1.x configuration.) Remember that /var/lib/install is gone, so its /etc/openvpn now. And /etc/default/openvpn holds startup information.


Is the script made by you or is it a download from the catalog?
Can I take a look at it?

tnbt
12-28-2006, 09:05 PM
I can call the script as user, just tested it and it works.

SeRi@lDiE
12-28-2006, 09:31 PM
Take it off sudo and then call it as user.

tnbt
12-28-2006, 09:41 PM
ok. but if it needs root privilegies, the entry in sudoers should help, right?!

SeRi@lDiE
12-28-2006, 10:20 PM
Yes but that means you wont be able to execute it from the GUI you have to be in xterm calling it using sudo or as root only.

tnbt
12-29-2006, 04:26 AM
arghh, yes sure. mixed it up. :)

so at least there is no chance to call it from the gui, or is there any trick which I can use?

SeRi@lDiE
12-29-2006, 09:26 AM
I could give it a try and see how could I manipulate maemo... but I would need your files...
I know in a full Linux enviroment there is plenty of ways to do it.

aflegg
12-29-2006, 10:20 AM
Easiest way: have another script which calls "sudo the_original_script.sh" and call new_script.sh from the application menu.

SeRi@lDiE
12-29-2006, 12:07 PM
Easiest way: have another script which calls "sudo the_original_script.sh" and call new_script.sh from the application menu.

That would do the trick...

tnbt
12-29-2006, 08:48 PM
good idea, will give it a try.

thanks so far.