This forum has been archived. All content is frozen. Please use KDE Discuss instead.

D-BUS support in gwenview

Tags: None
(comma "," separated)
jacekn
Registered Member
Posts
2
Karma
0
OS

D-BUS support in gwenview

Sat May 19, 2012 11:31 am
Hi,

I was wondering if there are any plans to add ability to control gwenview using D-BUS?
I was trying to find an image viever for Linux (ideally KDE of course) which I could easily control using CLI or D-BUS but there seems to be nothing there (there is actually display command but it is not really what I need)

I do not own a TV so I use my KDE desktop to play videos and music. To make it more convenient I created some hacky scripts which allow me to control music (amarok) and video (mplayer) remotely from a mobile phone or a tablet. It works great, especially with amarok which is very easy to control using D-BUS.
I was thinking about adding another functionality to my little hack which is ability to control image viewer to be able to show pictures to my friends while sitting comfortably on the sofa but I had no luck with that. Of course gwenview D-BUS interfaces would make is very easy to control image viewing from python scripts on CLI.

Regards,
Jacek
jacekn
Registered Member
Posts
2
Karma
0
OS

Re: D-BUS support in gwenview

Sun Jun 03, 2012 12:16 pm
I will answer my own question. Gwenview has D-BUS support, it is just slightly different than what I saw in amarok. I can trigger QT actions using D-BUS. Small code snippet below.

Code: Select all
import dbus

session_bus = dbus.SessionBus()
gwenview_bus = ""
for method in session_bus.list_names():
    if method.find("gwenview") != -1:
        gwenview_bus = method
        break

a = session_bus.get_object(gwenview_bus, "/gwenview/MainWindow_1/actions/go_next")
a.trigger()
User avatar
agateau
Moderator
Posts
97
Karma
0
OS

Re: D-BUS support in gwenview

Tue Jun 05, 2012 12:16 pm
Nice, thanks for sharing. Note that what you describe here should be usable to control any KDE application.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell