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

qdbus and PowerManagment

Tags: None
(comma "," separated)
tatewaki
Registered Member
Posts
3
Karma
0
OS

qdbus and PowerManagment

Wed Jul 06, 2011 7:23 am
Hey All

I'm trying to develop a plasmoid that can disable power saving, so when i watch flash it wont turn off the screen. For doing that I think i can use the org.freedesktop.PowerManagement.Inhibit function, but i'm at a lost on how.

I'm trying to call it with:

Code: Select all
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.Inhibit


And i know it takes 2 Qstring arguments so i give it: "Application name", and "Reason" but how do i give them to it?

I have tried to write:
Code: Select all
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.Inhibit 'firefox', 'Test'


but
Code: Select all
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.HasInhibit


returnes false.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: qdbus and PowerManagment  Topic is solved

Wed Jul 06, 2011 9:11 am
Try this:
Code: Select all
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.Inhibit 'firefox' 'Test'


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
tatewaki
Registered Member
Posts
3
Karma
0
OS

Re: qdbus and PowerManagment

Wed Jul 06, 2011 7:33 pm
Yes that works!

I found out that i can also use:
Code: Select all
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.Inhibit string:"YouTube" string:"None"


Bookmarks



Who is online

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