# How to pause Banshee when screen lock

I am running on Ubuntu 12.04 and Banshee version is 2.96, I am looking for plugin or script which can pause any track that is playing Banshee when I lock the screen.

Thanks.

-

Python script (save it and execute it).

I found it on bug page for launchpad with the following comment:

Untill banshee supports this natively the attached python snippet will do the job. It has a known problem that it will launch banshee when you lock the screen if it is not already running. I don't know enough about dbus to prevent this, and it doesnt bother me enough to make me figure it out (banshee is always running anyways).

Regarding comment:

It might be worth while asking this on coding stackexchange.

But the relevant part of it is this:

def Bconnect(session_bus):
if not session_bus.name_has_owner("org.bansheeproject.Banshee"):
return None
banshee = session_bus.get_object("org.bansheeproject.Banshee", "/org/bansheeproject/Banshee/PlayerEngine")
return banshee

-
This is an out of subject question, but is launchpad based on bugzilla ? –  Dan May 2 '12 at 15:33
It works... Is there a similar script for Rhthmbox too? Or common script that can be used to pause any track or movie playing in any player when the screen is locked. –  senthilkumar May 3 '12 at 18:18

Android has a banshee remote app that will, obviously based of app name, control banshee remotely. I have used it but haven't tested it in this type of situation. maybe this app will work

-

go to terminal and type banshee --pause

-
This does not pause when the screen is locked. Rather, it's an additional step (which the OP is trying to avoid) –  DrSAR Feb 25 '13 at 5:38
@DrSAR There's two ways to interpret the question. This answers one of them: how to pause Banshee once the screen is locked (vs. automatically whenever the screen locks). Since the question is vague, and since this method is probably of interest to anyone interested in automated ways, this should probably be considered an answer to the question and kept. –  Eliah Kagan Feb 25 '13 at 11:07