|
2011-04-09
, 19:51
|
Posts: 235 |
Thanked: 339 times |
Joined on Nov 2010
|
#2
|
The Following User Says Thank You to jstokes For This Useful Post: | ||
|
2011-04-09
, 19:56
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#3
|
|
2011-04-09
, 20:05
|
|
Posts: 855 |
Thanked: 612 times |
Joined on Oct 2010
@ Germany
|
#4
|
The Following User Says Thank You to Alfred For This Useful Post: | ||
|
2011-04-09
, 20:45
|
|
Posts: 2,473 |
Thanked: 12,265 times |
Joined on Oct 2009
@ Jerusalem, PS/IL
|
#5
|
run-standalone.sh dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:conky
|
2011-04-09
, 20:50
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#6
|
What i am going to write can be so much dumb, but it looks like a n00b solution to me. When you start an app, say click an icon, and then go to dashboard and to the desktop and again click the icon it just brings back your opened window. So (i suppose) if you would like a your Py App to open another app, he would open a window(if it is already open) or open it from the start... Please correct me if i am wrong...
|
2011-04-09
, 20:56
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#7
|
Code:run-standalone.sh dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:conky
The Following User Says Thank You to helex For This Useful Post: | ||
|
2011-04-09
, 21:02
|
Posts: 235 |
Thanked: 339 times |
Joined on Nov 2010
|
#8
|
The Following 2 Users Say Thank You to jstokes For This Useful Post: | ||
|
2011-04-09
, 21:32
|
|
Posts: 543 |
Thanked: 802 times |
Joined on Apr 2010
@ Germany
|
#9
|
You can, but it involves X calls from what I know. I don't know how you do it in Python, though. If you have xprop installed, you can invoke "xprop -root" and look at the _NET_ACTIVE_WINDOW or _MB_CURRENT_APP_WINDOW. The numbers represent a Window ID (XID). You can use them to get the WMCLASS or the title of an application
|
2011-04-10
, 08:26
|
Posts: 235 |
Thanked: 339 times |
Joined on Nov 2010
|
#10
|
Ah, thanks. I haven't known about this. But it seems more as a tool for developers... and after looking at the package I guess it is not a good idea to investigate how this works using python: Package
#!/usr/bin/env python import gtk screen = gtk.gdk.screen_get_default() root = screen.get_root_window() #active_window = screen.get_active_window() x = root.property_get("_MB_CURRENT_APP_WINDOW")[2] num = int(''.join(map(str,x))) #http://stackoverflow.com/questions/489999/python-convert-list-of-ints-to-one-number #print "0x0%lx" % num active_window = gtk.gdk.window_foreign_new(num) #if not active_window is None: wmclass = active_window.property_get("WM_CLASS")[2].split('\x00')[0] print wmclass
The Following 3 Users Say Thank You to jstokes For This Useful Post: | ||
I don't know if this is possible at maemo, at all. But perhaps someone has a solution for this:
I want to check in a small python application if a other application is already running.
If it is currently running I would like to bring it to the foreground. If it isn't running I would like to start this application.
Has anybody a Idea?
Does Hildon provide this thru the API?!
Please DONATE if you like my work!