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

Script: httpremote_amarok.pl [solved! code within!]

Tags: None
(comma "," separated)
asktoby
Registered Member
Posts
23
Karma
0
I am attempting to use the httpremote_amarok.pl script to control Amarok using my Palm.

I have set the DCOP dependancies up and the script runs. However, when I click the buttons on the webpage "http://192.168.0.2:50000/httpremote" amarok does not respond and the output log for httpremote reads:

=============================
ERROR: Multiple available KDE sessions!
Please specify the correct session to use with --session or use the
--all-sessions option to broadcast to all sessions.
[snip - repeated many times]
ERROR: Multiple available KDE sessions!
Please specify the correct session to use with --session or use the
--all-sessions option to broadcast to all sessions.
httpremote_amarok: Tk is not installed.httpremote_amarok: Configuration GUI will not be available.
=============================

Where should I put the --all-sessions switch?

Last edited by asktoby on Thu Feb 08, 2007 9:53 pm, edited 1 time in total.
asktoby
Registered Member
Posts
23
Karma
0
I have the solution:

To make it work, you must edit the file DCOP.pm found at /usr/local/share/perl/5.8.7/DCOP.pm

Here is the original:
Code: Select all
 package DCOP;
 
 use 5.008001;
 use strict;
 use warnings;
 
 our $VERSION = '0.036';
 
 sub new() {
         my $proto  = shift;
         my $class  = ref( $proto ) || $proto;
         my %params = @_;
         my $self   = {};
         $self->{ start }    = localtime;
         $self->{ user }     = $params{ user }    if ( $params{ user } );
         $self->{ target }   = $params{ target }  if ( $params{ target } );
         $self->{ control }  = $params{ control } if ( $params{ control } );
         chomp( my $basepath = `kde-config --expandvars --exec-prefix` );
         $self->{ dcop }  = "$basepath/bin/dcop ";
         $self->{ dcop } .= "--user $self->{user} " if ( $self->{ user } );
         $self->{ dcop } .= "$self->{target} "      if ( $self->{ target } );
         $self->{ dcop } .= "$self->{control} "     if ( $self->{ control } );
         bless( $self, $class );
         return $self;
 [snip]

And here is what you must modify it to:
Code: Select all
 
 package DCOP;
 
 use 5.008001;
 use strict;
 use warnings;
 
 our $VERSION = '0.036';
 
 sub new() {
         my $proto  = shift;
         my $class  = ref( $proto ) || $proto;
         my %params = @_;
         my $self   = {};
         $self->{ start }    = localtime;
         $self->{ user }     = $params{ user }    if ( $params{ user } );
         $self->{ target }   = $params{ target }  if ( $params{ target } );
         $self->{ control }  = $params{ control } if ( $params{ control } );
         chomp( my $basepath = `kde-config --expandvars --exec-prefix` );
         $self->{ dcop }  = "$basepath/bin/dcop ";
         $self->{ dcop } .= "--session /home/toby/.DCOPserver_tobyjr__0";
         $self->{ dcop } .= "$self->{target} "      if ( $self->{ target} );
         $self->{ dcop } .= "$self->{control} "     if ( $self->{ control} );
         bless( $self, $class );
         return $self;
 [snip]

(i.e. with the user line removed and the session line added).
Naturally, substitute your own computer name for tobyjr ;)

Last edited by asktoby on Thu Feb 08, 2007 9:59 pm, edited 1 time in total.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]