Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Remote Banshee Command Line Inquiry

  1. #1
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Remote Banshee Command Line Inquiry

    Hi. I wrote a small script for controlling Rhythmbox over the command line, especially for use across ssh (think remote control). Since Ubuntu is moving toward Banshee I am working to create a similar script for it. (The script should be much better as there are more controls available.)

    Here is the Rhythmbox script:

    Script for Skipping Tracks

    You will note that I make use of the $DISPLAY variable. This is important in a remote situation so that the system knows where to locate the running instance of Rhythmbox. (It is innocuous in a local situation.)

    I have tried running the same basic command for Banshee but it spawns a new instance each time. I have confirmed $DISPLAY on the remote box (using echo $DISPLAY.).

    Here is my test command:

    Code:
    DISPLAY=:0.0 banshee --query-artist
    This returns the artist when run locally (with or without DISPLAY).

    Any ideas?

    EDIT:

    Ok. I threw together a script for review:

    http://jamesisin.com/a_high-tech_ble...ipping-tracks/

    It is working well, but all feedback is appreciated.
    Last edited by jamesisin; August 2nd, 2011 at 10:48 PM. Reason: I have created a script candidate for review.
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  2. #2
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    Anyone else using Banshee?
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  3. #3
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    My research indicates it is related to d-bus:

    http://machine-cycle.blogspot.com/20...-sessions.html

    Here is another similar discussion:

    http://askubuntu.com/questions/53400...anshee-via-ssh
    Last edited by jamesisin; July 30th, 2011 at 11:11 PM.
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  4. #4
    Join Date
    Apr 2009
    Location
    Germany
    Beans
    2,134
    Distro
    Ubuntu Development Release

    Re: Remote Banshee Command Line Inquiry

    banshee exports an mpris interface over dbus:
    http://www.mpris.org/2.1/spec/
    with that you should be able to do almost everything.

    to query some of the objects use e.g dbus-send or the higher level qdbus:

    Code:
    #display objects
    qdbus org.bansheeproject.Banshee
    qdbus org.mpris.MediaPlayer2.banshee /org/mpris/MediaPlayer2
    #start play
    qdbus org.mpris.MediaPlayer2.banshee /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
    Last edited by MadCow108; July 30th, 2011 at 11:36 PM.

  5. #5
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    Maybe I'm not understanding what you are suggesting:

    Code:
    $ qdbus org.mpris.MediaPlayer2.banshee /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
    Service 'org.mpris.MediaPlayer2.banshee' does not exist.
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  6. #6
    Join Date
    Apr 2009
    Location
    Germany
    Beans
    2,134
    Distro
    Ubuntu Development Release

    Re: Remote Banshee Command Line Inquiry

    dbus is pretty much the ideal interface to remote control banshee and by using the mpris interface your script will also be able to control any other complying player (I think rhythmbox and vlc also implement this interface)
    banshee needs to be running in order to get this bus.

    It also exports a few other buses which might provide features going beyond mpris
    Code:
    qdbus  | grep banshee
     org.bansheeproject.Banshee
     org.bansheeproject.CollectionIndexer
     org.mpris.MediaPlayer2.banshee
    dbus-send should be available on more systems but is a bit more clunky, e.g. play next song:
    Code:
    dbus-send --session --type="method_call" --dest=org.mpris.MediaPlayer2.banshee /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
    for more information on the very flexible dbus read:
    http://dbus.freedesktop.org/doc/dbus-tutorial.html
    Last edited by MadCow108; July 31st, 2011 at 02:53 AM.

  7. #7
    Join Date
    Jan 2010
    Location
    No longer SoFl
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    "banshee command line" turned up this thread.



  8. #8
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    Thanks to both of you.

    MadCow - The qdbus command only returns the first two entries on the machine in question. Are there additional packages required for mpris?

    SoFl W - I'll take a look. I was hoping to write something in BASH and to keep it (as) portable (as possible), but this Python script may have some tricks I can use.

    Thus far I have found that using this line makes my command usable:

    Code:
    export $(strings /proc/*/environ| grep DBUS_SESSION | tail -1)
    If I run that first I am able to use the commands associated with banshee from the terminal (through ssh).

    I suppose it would work to just add that line early in a script and all would be well. I am not confident that is a wise maneuver since I am not familiar with what exactly is being exported.
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  9. #9
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    Ok. I threw together a script for review:

    http://jamesisin.com/a_high-tech_ble...ipping-tracks/

    It throws a bunch of errors (I tried hiding using > /dev/null 2>&1 but it's not right), but it does what it's supposed to do. If anyone can help me hide those errors it would be much appreciated.
    Last edited by jamesisin; August 2nd, 2011 at 10:51 AM. Reason: nul should be null
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  10. #10
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,395
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Remote Banshee Command Line Inquiry

    I fixed a bunch of annoyances and slickified the script a bit. It seems to be working quite well.

    Any feedback is appreciated.

    http://jamesisin.com/a_high-tech_ble...ipping-tracks/
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •