How would I use Alltray to launch a python script?

Asked by Kenny Schiff

I'm using Screenlets under Gnome and I would like to launch a Screenlet and have it docked in the notification area. The screenlet is triggered by a python script: python -u /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py

I tried modifying a launcher so that it said: alltray python -u /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py but while that does put alltray in the notification area and launch the screenlet, show/hide doesn't function.

Not sure whether what I want to do is possible.

Question information

Language:
English Edit question
Status:
Answered
For:
AllTray Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael B. Trausch (mtrausch) said :
#1

I'm not entirely familiar with screenlets.

What version of AllTray are you using, and can you enable debugging output? If you are running AllTray 0.70 or prior, debug like this:

 $ alltray -d python -u \
     /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py

If running one of the newer releases of AllTray (0.7.x) you can enable debugging like this:

 $ ALLTRAY_DEBUG=ALL alltray -D \
     python -u /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py

The output of that log may be able to provide a clue as to why it is not working.

Revision history for this message
Kenny Schiff (kschiff) said :
#2

I'm running 0.69. Here is the output from a session

kschiff@ubuntu:~$ alltray -d python -u \
> /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py
command without args: python
basename: python
command: python -u /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py
win->title_time: 0
win->notray: 0
HAVE MANAGER WINDOW
win->libsyp_window id: 44040195
execute program: python -u /home/kschiff/.screenlets/Toodledo/ToodledoScreenlet.py
lib is here: /usr/lib
old preload: (null)
preload string: LD_PRELOAD=/usr/lib/liballtray.so.0.0.0
wait for window
First workarround didnt work let run a second manual workarround
First workarround didnt work let run a second manual workarround
location: /usr/lib/xulrunner-1.9.0.13/libxpcom.so
before 3
CachingBackend: Loading instances from cache
CachingBackend: Loading <Toodledo2>
Found a running session of Toodledo, adding new instance by service.
Error in screenlets.services.get_service_by_name: org.freedesktop.DBus.Error.ServiceUnknown: The name org.screenlets.Toodledo was not provided by any .service files
Screenlet has already been added to /tmp/screenlets/screenlets.kschiff.running
Loading instances in: /home/kschiff/.config/Screenlets/Toodledo/default/
File: Toodledo2.ini
/home/kschiff/.config/Screenlets/Toodledo/default/Toodledo2
Set options in ToodledoScreenlet
liballtraynomap_filter event: ClientMessage
got window from lib: 71303175
found child window: 71303175
child have pid: 14457
get_window_icon with size request: 30x30
ERROR in read_rgb_icon
rgb failed
src_pixmap is none
need fallback icon
command_menu->len: 0
have manager window.... now creat_tray.....
get_window_icon with size request: 24x24
read_rgb_icon --> ok
update window title
net_wm_visible_name failed
title: ToodledoScreenlet.py
win->title: ToodledoScreenlet.py
theme is: Clearlooks
theme name: Clearlooks
theme_file: </home/kschiff/.themes/Clearlooks/metacity-1/metacity-theme-1.xml>
Failed to read theme from file /home/kschiff/.themes/Clearlooks/metacity-1/metacity-theme-1.xml: Failed to open file '/home/kschiff/.themes/Clearlooks/metacity-1/metacity-theme-1.xml': No such file or directory
theme_file: </usr/local/share/themes/Clearlooks/metacity-1/metacity-theme-1.xml>
Failed to read theme from file /usr/local/share/themes/Clearlooks/metacity-1/metacity-theme-1.xml: Failed to open file '/usr/local/share/themes/Clearlooks/metacity-1/metacity-theme-1.xml': No such file or directory
theme_file: </usr/share/themes/Clearlooks/metacity-1/metacity-theme-1.xml>
normal found !
right_titlebar_edge: 4 !
gnome map notify
one under root function
current runner: 71303175
target_our_w: 285, target_our_h: 500
  Relative upper-left Y: 105
visibility notify state: 2
property notify
icon_window_configure_event: 24x22
update_tray_icon: real plug size: 24x22
resize = TRUE
get_window_icon with size request: 22x22
read_rgb_icon --> ok
icon_window_configure_event: 22x22
update_tray_icon: real plug size: 22x22
resize = TRUE
get_window_icon with size request: 22x22
read_rgb_icon --> ok
icon_window_configure_event: 22x22
update_tray_icon: real plug size: 22x22
resize = TRUE
get_window_icon with size request: 22x22
read_rgb_icon --> ok
property notify
configure notify
property notify
property notify
property notify
property notify
property notify
property notify
property notify
property notify
Restored instances from session 'default' ...
configure notify
configure notify
configure notify
configure notify
OK
configure notify
configure notify
icon window press event
active window id 39845891
show
first click
property notify
configure notify
icon window press event
active window id 39845891
show
first click
property notify
configure notify
icon window press event
undock_call
destroy_all_and_exit
mapped
check if.......
Segmentation fault
kschiff@ubuntu:~$

Revision history for this message
Michael B. Trausch (mtrausch) said :
#3

Kenny,

Can you provide me with instructions on replicating this, including how to set up the screenlets initially?

Also, can you try with AllTray 0.7.4dev and see if the problem still exists there? AllTray 0.7.4dev can be downloaded from Launchpad. Thanks!

Revision history for this message
Kenny Schiff (kschiff) said :
#4

I'm running Ubuntu 9.04, and have Screenlets 0.1.2 installed. I was trying to launch a custom screenlet based on a web app called Toodledo, but the same issue exists with the stock ones, so here's what you can easily do to recreate the issue.

* Install Screenlet 0.1.2 (it's in the repositories)
* Launch the screenlet manager.
* Choose one of the stock screenlets (e.g. Notes), and select "Create Desktop Shortcut" from left sidebar. This will create a shortcut to the proper Python scrip on the desktop
* Modify the shortcut to prefix the script with alltray (e.g. alltray python -u /usr/share/screenlets/Notes/NotesScreenlet.py)
* The Notes Screenlet will launch, and Alltray will end up in the launcher panel, but show/hide will do nothing

Tried compiling AllTray 0.7.4dev, but had problems with compiling it (forgive my greenness on this). Here's the tail end of my terminal session after running this command

kschiff@ubuntu:/media/sda1/05 Downloads/alltray-0.7.4dev$ ./configure

.......

checking for GOBJECT... yes
checking for GTOP... no
configure: error: libgtop-2.0 is required
kschiff@ubuntu:/media/sda1/05 Downloads/alltray-0.7.4dev$ make
make: *** No targets specified and no makefile found. Stop.
kschiff@ubuntu:/media/sda1/05 Downloads/alltray-0.7.4dev$ make check
make: *** No rule to make target `check'. Stop.

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Michael B. Trausch
Sent: Friday, September 04, 2009 10:03 AM
To: Kenny Schiff
Subject: Re: [Question #80478]: How would I use Alltray to launch a pythonscript?

Your question #80478 on AllTray changed:
https://answers.edge.launchpad.net/alltray/+question/80478

    Status: Open => Needs information

Michael B. Trausch requested for more information:
Kenny,

Can you provide me with instructions on replicating this, including how
to set up the screenlets initially?

Also, can you try with AllTray 0.7.4dev and see if the problem still
exists there? AllTray 0.7.4dev can be downloaded from Launchpad.
Thanks!

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.edge.launchpad.net/alltray/+question/80478

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
Michael B. Trausch (mtrausch) said :
#5

No problem. Do:

sudo apt-get install libgtop2-dev libwnck-dev

Which should pull the right libraries so that you can build 0.7.4dev. I will try to take a look at this sometime next week, assuming life doesn't blow up on me. :-)

Revision history for this message
Kenny Schiff (kschiff) said :
#6

Should I install AllTray 0.69 first

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Michael B. Trausch
Sent: Friday, September 04, 2009 12:03 PM
To: Kenny Schiff
Subject: RE: [Question #80478]: How would I use Alltray to launch apythonscript?

Your question #80478 on AllTray changed:
https://answers.edge.launchpad.net/alltray/+question/80478

    Status: Open => Needs information

Michael B. Trausch requested for more information:
No problem. Do:

sudo apt-get install libgtop2-dev libwnck-dev

Which should pull the right libraries so that you can build 0.7.4dev. I
will try to take a look at this sometime next week, assuming life
doesn't blow up on me. :-)

--
To answer this request for more information, you can either reply to
this email or enter your reply at the following page:
https://answers.edge.launchpad.net/alltray/+question/80478

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
Michael B. Trausch (mtrausch) said :
#7

On Fri, 2009-09-04 at 16:06 +0000, Kenny Schiff wrote:
> Question #80478 on AllTray changed:
> https://answers.launchpad.net/alltray/+question/80478
>
> Status: Needs information => Open
>
> Kenny Schiff gave more information on the question:
> Should I install AllTray 0.69 first
>

No, that's not necessary. It will work either way. I may have an
alternative solution for you soon; I just uploaded 0.7.4dev to the
AllTray developers' PPA.

 --- Mike

Can you help with this problem?

Provide an answer of your own, or ask Kenny Schiff for more information if necessary.

To post a message you must log in.