FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-16-2011, 08:02 PM
Greg Woods
 
Default DBUS, xhost, etc: remote control of amarok

I used to be able to do this fairly easily, but D-bus seems to have made
this a lot more complicated than it used to be. I just want to be able
to run a script via ssh to make Amarok do something (like pause, skip to
the next track, etc.). I have this command:

qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.Pause

This works fine, but only if I run it from an xterm launched from inside
the same X session as Amarok. If I try to do it through an ssh session,
I get this:

Could not connect to D-Bus server:
org.freedesktop.DBus.Error.Spawn.ExecFailed: /bin/dbus-launch terminated
abnormally with the following error: Autolaunch error: X11
initialization failed.

This happens whether the ssh user is the same user as the X session, a
different user, or root.

I have played around with various DISPLAY settings with no luck, but I
doubt if that will work in any event because according to lsof, Xorg
isn't even listening on the display port anyway. I have also tried, in
the X session, doing "xhost +" and that doesn't change anything either.
I confess that I really don't understand the connection between X and
D-bus, and all I really want is to make this work.

I am running Gnome and Amarok is a KDE app, so maybe there is some other
KDE-related service that needs to be started? Anybody been able to make
something like this work?

--Greg


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-16-2011, 08:37 PM
Tom Horsley
 
Default DBUS, xhost, etc: remote control of amarok

On Wed, 16 Feb 2011 14:02:18 -0700
Greg Woods wrote:

> Anybody been able to make
> something like this work?

I haven't tried it, but there will probably be an environment variable
named DBUS_SESSION_BUS_ADDRESS in the X session where amarok is running.
You need to have the same contents for that variable in the ssh session
where you try to run your dbus command (I'd imagine, anyway).
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-17-2011, 07:58 PM
Greg Woods
 
Default DBUS, xhost, etc: remote control of amarok

On Wed, 2011-02-16 at 16:37 -0500, Tom Horsley wrote:
> On Wed, 16 Feb 2011 14:02:18 -0700
> Greg Woods wrote:
>
> > Anybody been able to make
> > something like this work?
>
> I haven't tried it, but there will probably be an environment variable
> named DBUS_SESSION_BUS_ADDRESS in the X session where amarok is running.
> You need to have the same contents for that variable in the ssh session
> where you try to run your dbus command (I'd imagine, anyway).

Thanks for the suggestion, but I tried that and it didn't help. Even if
it did, my script being run via ssh would have had no way of knowing
what the correct value of this variable should be. I hard coded it for
the test, but next time, after a new login, it could be different.

--Greg



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-17-2011, 08:29 PM
suvayu ali
 
Default DBUS, xhost, etc: remote control of amarok

On Thu, Feb 17, 2011 at 12:58 PM, Greg Woods <woods@ucar.edu> wrote:
> Thanks for the suggestion, but I tried that and it didn't help. Even if
> it did, my script being run via ssh would have had no way of knowing
> what the correct value of this variable should be. I hard coded it for
> the test, but next time, after a new login, it could be different.

Although this is off-topic but just FYI, you can use the e flag for ps
to get the environment variables. So you could try something like
this,

ps e -p $PID

--
Suvayu

Open source is the future. It sets us free.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-17-2011, 11:30 PM
dexter
 
Default DBUS, xhost, etc: remote control of amarok

On 16 February 2011 21:02, Greg Woods <woods ucar.edu> wrote:
> I am running Gnome and Amarok is a KDE app, so maybe there is some other
> KDE-related service that needs to be started? Anybody been able to make
> something like this work?

I ssh into a box from across the room to change the volume in kmix
with this script in ~/bin/vol- :

#!/bin/bash
# reduce kmix volume using dbus api
export DISPLAY=:0
qdbus org.kde.kmix /Mixer0 org.kde.KMix.decreaseVolume PCM:0

also in ~/bin/vol+ :

#!/bin/bash
# increase kmix volume using dbus api
export DISPLAY=:0
qdbus org.kde.kmix /Mixer0 org.kde.KMix.increaseVolume PCM:0

...dex
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-18-2011, 06:09 PM
Greg Woods
 
Default DBUS, xhost, etc: remote control of amarok

On Fri, 2011-02-18 at 00:30 +0000, dexter wrote:

> #!/bin/bash
> # reduce kmix volume using dbus api
> export DISPLAY=:0
> qdbus org.kde.kmix /Mixer0 org.kde.KMix.decreaseVolume PCM:0

If I run lsof on my Xorg process, it doesn't show that it is listening
on the X display port, or any TCP ports for that matter (generic Gnome
installation under F14). So obviously, for me, setting DISPLAY is not
going to matter.

What do I have to do to get Xorg to listen on the display port?

--Greg


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 03:18 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org