2

I would like to do banshee --next, or just control banshee in general, from a virtual console (e.g., the one I get when I press Ctr-Alt-F1).

Is that possible? How can I do it?

2 Answers 2

2

It turns out my X session with dbus running has the following environment variable set, which is accessible from all terminal emulators in X:

DBUS_SESSION_BUS_ADDRESS

It's contents (`echo $DBUS_SESSION_BUS_ADDRESS) appear to denote the Unix socket used by Dbus.

Getting banshee terminal commands to work in a virtual console has turned out to be a simple matter of sharing that value with the virtual terminal.

To automate it, I wrote the following simple script:

$ cat get_dbus_addr.sh 
#!/bin/bash
#Use this file for sharing the most recent DBus socket address 
FILE="/tmp/${USER}_DBUS_SESSION_BUS_ADDRESS" 

if [ ! -z "$DBUS_SESSION_BUS_ADDRESS" ]
then
  echo $DBUS_SESSION_BUS_ADDRESS > "$FILE"
else
  export DBUS_SESSION_BUS_ADDRESS=`cat "$FILE"`
fi

I source the script from the appropriate terminal config files (so that it gets sourced in both GUI and in the virtual console). Sourcing it in the GUI saves the value to the sharing file in /tmp and sourcing it in a Virtual console (where the ENV variable isn't set) loads it.

1

I take it all back-- tmux enables a number of terminals (or windows) to be accessed and controlled from a single terminal like screen. I was able to banshee --next from a virtual console. Very cool utility.

Unfortunately, until they fix the known bug, no it is not possible because banshee uses DBus to get those commands from the command line to the player. Best workaround would be to use CTRL-ALT-T instead of CTRL-ALT-F1. Or at least that works for me on 12.04.

3
  • I've noticed it does. What I had in mind was if it would be possible to tap into dbus from a virtual console in order to control banshee. (I'd like to stay in control of banshee when I'm inside of fullscreen apps that disable hotkeys and can't be minimized) Jan 20, 2014 at 21:20
  • If this doesn't fit the bill, I don't know what will.
    – JB0x2D1
    Jan 23, 2014 at 22:37
  • I've noticed you changed the answer. Yup, that makes sense -- start a tmux session in GUI and attach it from the virtual console. It's essentialy tmux what shares the DBUS_SESSION_BUS_ADDRESS variable then. Jan 24, 2014 at 0:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .