maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Troubleshooting (https://talk.maemo.org/forumdisplay.php?f=6)
-   -   adding application to system menue (https://talk.maemo.org/showthread.php?t=3793)

tnbt 2006-12-29 00:21

adding application to system menue
 
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 2006-12-29 01:17

When you call on the script from xterm are you as root or user?

tnbt 2006-12-29 01:22

I call the script as user and there is an sudoers entry as well.

SeRi@lDiE 2006-12-29 01:28

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 2006-12-29 01:31

I was looking at some of the VPN solutions at the Application Catalog and it looks like VPN needs root privilages...

From OpenVPN

Code:

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 2006-12-29 02:05

I can call the script as user, just tested it and it works.

SeRi@lDiE 2006-12-29 02:31

Take it off sudo and then call it as user.

tnbt 2006-12-29 02:41

ok. but if it needs root privilegies, the entry in sudoers should help, right?!

SeRi@lDiE 2006-12-29 03:20

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 2006-12-29 09:26

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 2006-12-29 14:26

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 2006-12-29 15:20

Easiest way: have another script which calls "sudo the_original_script.sh" and call new_script.sh from the application menu.

SeRi@lDiE 2006-12-29 17:07

Quote:

Originally Posted by aflegg
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 2006-12-30 01:48

good idea, will give it a try.

thanks so far.


All times are GMT. The time now is 15:38.

vBulletin® Version 3.8.8