Nazz has asked for the wisdom of the Perl Monks concerning the following question:
and this is what I thought it should look like in perl.#!/usr/bin/python import dbus bus = dbus.Bus(dbus.Bus.TYPE_SESSION) devobj = bus.get_object('org.gnome.PowerManager', '/org/gnome/PowerMan +ager') dev = dbus.Interface(devobj, "org.gnome.PowerManager") cookie = dev.Inhibit('Nautilus', 'Copying files') #do something dev.UnInhibit(cookie)
use Net::DBus; #get the session bus my $bus = Net::DBus->session; #Get the Gnome power manager object === Wrong!!! my $devobj = $bus->get_object("/org/gnome/PowerManager", "org.gnome.Po +werManager"); #Get the interface === Wrong!!! my $dev = $bus->Interface($devobj,"org.gnome.PowerManager"); my $cookie = $dev->Inhibit("Squeezecenter", "Playing"); .... more code $dev->UnInhibit($cookie); 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Anyone speak dbus?
by gam3 (Curate) on Jan 20, 2008 at 14:17 UTC | |
by Anonymous Monk on Jan 21, 2008 at 13:52 UTC | |
|
Re: Anyone speak dbus?
by bigmacbear (Monk) on Jan 21, 2008 at 18:47 UTC | |
by Nazz (Novice) on Jan 22, 2008 at 09:36 UTC | |
|
Re: Anyone speak dbus?
by Anonymous Monk on Jan 20, 2008 at 13:39 UTC |