Reply
Thread Tools
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#21
Originally Posted by rolfok View Post
My jPhone is missing the dbus python module. How did you install it?

>>>import dbus
>>>ImportError: No module named dbus
the package-name is dbus-python

Repository: jolla
Name: dbus-python
Version: 1.0.0-1.1.1
Arch: armv7hl
Hersteller: meego
Installiert: Ja
Status: aktuell
Installierte Größe: 412,6 KiB
Zusammenfassung: D-Bus Python Bindings
Beschreibung:
D-Bus python bindings for use with python programs.
 

The Following User Says Thank You to EmaNymton For This Useful Post:
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#22
Just in case someone needs it:
Code:
dbus-send --session --type=method_call --dest=org.sailfishos.browser / org.sailfishos.browser.openUrl array:string:"talk.maemo.org"
opens the browser at the given url.

and
Code:
dbus-send --session --type=method_call --dest=com.jolla.email.ui /com/jolla/email/ui com.jolla.email.ui
opens the mail-program.

Last edited by EmaNymton; 2014-01-10 at 17:11.
 

The Following 8 Users Say Thank You to EmaNymton For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#23
Originally Posted by EmaNymton View Post
Ok, now with working pop up notification and using jolla icons placed in /usr/share/themes/jolla-ambient/meegotouch/icons/

https://dl.dropboxusercontent.com/u/...0108112941.jpg

Code:
#!/usr/bin/python
import dbus

bus = dbus.SessionBus()
object = bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications')
interface = dbus.Interface(object,'org.freedesktop.Notifications')
#print(interface.GetCapabilities())

interface.Notify("app_name",
                 0,
                 "icon-m-notifications",
                 "Here is the title",
                 "and here the body",
                 dbus.Array(["default", ""]),
                 dbus.Dictionary({"x-nemo-preview-body": "preview body",
                                  "x-nemo-preview-summary": "preview summary"},
                                  signature='sv'),
                 0)
Hi
Why when I try to run your script, I always get this error:
Code:
[root@localhost ~]# python /usr/share/jolla-mods/test.py
Traceback (most recent call last):
  File "/usr/share/jolla-mods/test.py", line 4, in <module>
    bus = dbus.SessionBus()
  File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 211, in __new__
    mainloop=mainloop)
  File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Any advice ?

Thanks
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#24
Originally Posted by Schturman View Post
Hi
Why when I try to run your script, I always get this error:
[CODE][root@localhost ~]# python /usr/share/jolla-mods/test.py
As a general rule, try to avoid using root when it is not strictly required.

To use the notifications service, you should connect to the "session bus" -- i.e. the D-Bus instance for the currently logged in user, which is "nemo" on the Jolla. You can't do this as root (not easily, that is).

Last edited by javispedro; 2014-01-27 at 03:23.
 

The Following User Says Thank You to javispedro For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#25
Originally Posted by javispedro View Post
As a general rule, try to avoid using root when it is not strictly required.

To use the notifications service, you should connect to the "session bus" -- i.e. the D-Bus instance for the currently logged in user, which is "nemo" on the Jolla. You can't do this as root (not easily, that is).
ahhh, you mean something like this in n9:
source /tmp/session_bus_address.user ?

What the fight command fo jolla ?
tnanks

Last edited by Schturman; 2014-01-27 at 07:57.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#26
Originally Posted by Schturman View Post
ahhh, you mean something like this in n9:
source /tmp/session_bus_address.user ?
No, I mean, just don't use devel-su when not necessary, as in this case.
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#27
Originally Posted by javispedro View Post
No, I mean, just don't use devel-su when not necessary, as in this case.
Oh... sorry, now I see

Another question, how I can see all services of dbus ? For example on N9 I need write only qdbus to see all of them, but in jolla I get this answer:
Code:
[nemo@localhost ~]$ qdbus
-bash: qdbus: command not found
[nemo@localhost ~]$
Same as root....
 
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#28
Install package qt5-qttools-qdbus

Then start with /usr/lib/qt5/bin/qdbus

Code:
[nemo@localhost ~]$ /usr/lib/qt5/bin/qdbus --help
Usage: qdbus [--system] [--bus busaddress] [--literal] [servicename] [path] [method] [args]

  servicename       the service to connect to (e.g., org.freedesktop.DBus)
  path              the path to the object (e.g., /)
  method            the method to call, with or without the interface
  args              arguments to pass to the call
With 0 arguments, qdbus will list the services available on the bus
With just the servicename, qdbus will list the object paths available on the service
With service name and object path, qdbus will list the methods, signals and properties available on the object

Options:
  --system          connect to the system bus
  --bus busaddress  connect to a custom bus
  --literal         print replies literally
 

The Following 5 Users Say Thank You to EmaNymton For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#29
 
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#30
Hi!

On the n900/n9 this would set the silent profile:
Code:
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"
What would be the Sailfish equivalent?

Thanks
 

The Following User Says Thank You to solbrit For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 10:53.