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?
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.
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.