[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: launching apps from the menu



On Sun, 02 Oct 2011 14:12:26 +0100, Richard Bown wrote:

> The launcher in the menu points to this script:-

(...)

> From the CLI it works fine from any location and fails to run when
> started from the menu.

It fails? Why do you think it fails? 

I mean, does the python script launches a GUI based program, runs a 
daemon/service in background or takes any visible action?

> file permissions are :-
> -rwxrwxrwx 1 richard richard 779 Oct
> 
> so anyone and their dog can run it, what have I missed ?, I done it many
> time on other distros.

I don't see anything wrong with your script :-?

Let's see (simplified sample):

sm01@stt008:~/Desktop$ cat test.sh
#! /bin/bash
cd /home/sm01/Desktop
python test.py

sm01@stt008:~/Desktop$ cat test.py
#!/usr/bin/python
a = open("/home/sm01/Desktop/sample.txt", "w") 
a.write("sampe text\n")

And the launcher file looks like:

sm01@stt008:~/Desktop$ cat tessto.desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=tessto
Type=Application
Terminal=false
Icon[es_ES]=gnome-panel-launcher
Exec=/home/sm01/Desktop/test.sh
Name[es_ES]=tessto
Icon=gnome-panel-launcher
GenericName[es_ES]=

After double-clicking on the launcher, the small python script is run and 
the file (which was not present before running it) is created with the 
right content which means the script executes successfully when called 
from the launcher:

sm01@stt008:~/Desktop$ cat sample.txt
sampe text

Greetings,

-- 
Camaleón


Reply to: