You are not logged in.

#1 2013-10-03 07:44:29

Joomla12
Member
Registered: 2012-04-25
Posts: 27

Properly Start dbus with SLiM?

I may have worded the title a bit wrong, so bear with me. Anyway, here's my issue. I run an Icecast radio and stream to it using Rhythmbox. I use a basic XChat script to announce the current song in an IRC channel that listeners join. This script gets the track info from Rhythmbox's stream through dbus (I'm assuming). Problem is, when using SLiM, startx, or any other DM that isn't GDM or some other GNOME derived DM, the script doesn't work. It's rather boggling since my xinitrc is proper, and it only works when using GDM. Below is my xinitrc and the script itself. Any help is greatly appreciated.

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
exec openbox-session
#!/usr/bin/perl -w

Xchat::register("Rhythmbox Now Playing script for XChat", "0.1", "Rhythmbox Now Playing script for XChat" , 
"");
Xchat::hook_command("np", "nowPlaying");

sub nowPlaying
{
    # Check if a rhythmbox process exists.    
    if (`ps -C rhythmbox` =~ /rhythmbox/) {
        # Check if rhythmbox streams music
        $title = `rhythmbox-client --print-playing-format %st`;
        if (length $title > 1) {
            $title = `rhythmbox-client --print-playing-format %st\\ -\\ %tt`;
        } else {
            $title = `rhythmbox-client --print-playing-format %tt\\ by\\ %ta\\ from\\ the\\ album\\ %at\\ ♪`;
        }

        # Send out now playing line
        chop $title;
        Xchat::command("me is listening to " . $title);
    } else {
        Xchat::print("Rhythmbox is not running.");
    }
}

Edit: This might be helpful. I get this when starting Rhythmbox from a terminal.

(rhythmbox:6606): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
(rhythmbox:6606): Rhythmbox-WARNING **: Unable to grab media player keys: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SettingsDaemon was not provided by any .service files

Last edited by Joomla12 (2013-10-03 07:49:07)

Offline

#2 2013-10-03 08:29:06

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Properly Start dbus with SLiM?

dbus is properly started, but the gnome session manager and settings daemon are not started by slim/xinitrc/openbox. I recently read somewhere that GDM starts a gnome session (when displaying the login screen, before you even get to xinitrc), so I suppose you don't see those warnings when using GDM? That might be the cause, but I can't be sure.

Did you try running those rhythmbox-client commands in a terminal to see if you get a (more informative) error message?

Last edited by Raynman (2013-10-03 08:29:26)

Offline

#3 2013-10-03 09:17:11

Joomla12
Member
Registered: 2012-04-25
Posts: 27

Re: Properly Start dbus with SLiM?

 ~  rhythmbox-client --print-playing-format %tt                                      
Warsickle - Call For Help (Hexis Remix)

That seems to be working fine. Also, thanks for correcting me. I Googled the error to see if I could find anything relevant to the situation, and most everything I found was related to the use of GTK themes.

Edit: Been doing some more digging and found this thread. What was suggested in it caused a lot of things to break, so I'm adding the below to my OpenBox autostart script instead in hopes that it works.

if test -x /usr/lib/gnome-settings-daemon/gnome-settings-daemon >/dev/null; then
  /usr/lib/gnome-settings-daemon/gnome-settings-daemon &
 elif which gnome-settings-daemon >/dev/null 2>&1; then
  gnome-settings-daemon &
fi

Edit 2: Nope, didn't fix it. Interestingly enough though, it did make GTK applications look incredibly uniform like they had started using a fallback theme. I'll continue playing around and hope I find something.
Edit 3: Alright, so I don't need the settings daemon. All it really handles is the appearance. So, I apparently need the session manager running. Does this mean if I do get it properly setup, I'll have a hidden GNOME session just squatting on my resources? Seems like there's gotta be a better way.

Last edited by Joomla12 (2013-10-03 12:25:09)

Offline

Board footer

Powered by FluxBB