sleepy (shutdown script)
Amarok 2.x Scripts
Description:

Sleep script like the old Nightingale. At the moment sleepy supports suspend, hibernate, shutdown and stopping amarok.
Also supports to turn off the screen when enabled. This option will lock the screen and turn it off after 10 seconds.

Changelog:

6 years ago

0.9.3
Added dutch and czech translations
0.9.2
Made translations possible and added french translation
0.9.1
Fixed some typos (thanks bashlnx!)
0.9
- Use Hal now to suspend, hibernate and shutdown. This means (hopefully) that sleepy also works for users who don't have a full kde installation.
- Added the option to quit Amarok.
- There are 2 categories of actions now: General and Amarok actions, both can be set independly.
0.8.2
fixed the pause function before shutting down.
0.8.1
fixed a bug in turn the screen off.
0.8
added the option to turn off the screen.
0.7.1
support for stopping amarok
custom messages for each action
0.7
support for shutdown
0.6
support for suspend and hibernate
triggers are: time based, songs played, play stopped.

2 years ago

evilblade

Is there ANY way to make this script enabled automatically on amarok's startup? Please, I really need it :)

Report

5 years ago

poomerang

Hi,
are you still mantaining this script?
It should be updated as hal is getting deprecated: it's no more in use in KDE 4.6 (so for instance Kubuntu 11.04 doesn't install hal) in Gnome and in Xfce 4.8.
Major distributions are planning to drop or have already dropped it (see http://wiki.debian.org/HALRemoval https://wiki.ubuntu.com/Halsectomy http://fedoraproject.org/wiki/Features/HalRemoval)

ConsoleKit might be a replacement but i'm not quite sure

Greetings, and thanks for the script anyways!

Report

5 years ago

poomerang

consolekit should work at least for shutdown/restart, see http://www.freedesktop.org/software/ConsoleKit/doc/ConsoleKit.html#Manager

no clues about suspend/hibernate though

Report

5 years ago

poomerang

the solution for suspend/hibernate should be Upower http://upower.freedesktop.org/docs/UPower.html

Report

5 years ago

poomerang

and my soliloquy ends (finally) with the patch needed:

--- action.js 2010-08-23 16:25:33.000000000 +0200
+++ action2.js 2011-09-15 12:19:23.932470146 +0200
@@ -27,17 +27,17 @@
}

function suspend() {
- var suspend = "qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend 1";
+ var suspend = "qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend";
this.execute(suspend);
}

function hibernate() {
- var hibernate = "qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate";
+ var hibernate = "qdbus --system org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Hibernate";
this.execute(hibernate);
}

function shutdown() {
- var shutdown = "qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown";
+ var shutdown = "qdbus --system org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop";
this.execute(shutdown);
}


check to have consolekit and upower installed in order for this to work (this should be default in all "modern" distros)

cheers

Report

7 years ago

pamputt

Do you plan to translate your script?

Report

7 years ago

tmske

I have no idea how to do translations for a script, but I can take a look at it if you like. What translations do you want?

Report

7 years ago

pamputt

I am French, so I would like use this script in french. If you want, I can send you translation of your script by email.

Report

7 years ago

tmske

Ok, I'll try to take a look at translations, but it probably won't be this week because I'm very busy at the moment. You can find my email on the homepage of sleepy.

Report

6 years ago

martosurf

Tell us when you're ready to add translations and I'll submit one for Español de Argentina (Castellano)

Report

6 years ago

tmske

Added french translation, if you want, add some other translations and mail them to me.

Report

6 years ago

martosurf

Sure, but I need a template...

Report

6 years ago

tmske

You can find a template here: http://gitorious.org/sleepy/sleepy/trees/master/translations

Report

7 years ago

ilpianista

Hi, nice script but can you add "Amarok Stop" or "Amarok Pause" to triggers? :)
thanks

Report

7 years ago

ilpianista

Done ^^

--- sleepy/action.js~ 2009-10-18 14:09:24.000000000 +0200
+++ sleepy/action.js 2009-10-21 02:21:18.214389001 +0200
@@ -58,6 +58,7 @@
this.suspend = suspend;
this.hibernate = hibernate;
this.shutdown = shutdown;
+ this.stop = stop;
this.execute = execute;
}

@@ -76,6 +77,11 @@
this.execute(shutdown);
}

+function stop(p) {
+ var stop = "Amarok.Engine.Stop(true)";
+ this.execute(stop);
+}
+
function execute(p) {
//print("execute:::");
//print(p);
--- sleepy/gui.js~ 2009-10-18 14:06:54.000000000 +0200
+++ sleepy/gui.js 2009-10-21 02:23:58.954369985 +0200
@@ -80,7 +80,11 @@
if (this.dialog.actionBox.action.currentIndex == 1) {
a = function() {x.action.hibernate();};
} else {
- a = function() {x.action.shutdown();};
+ if (this.dialog.actionBox.action.currentIndex == 2) {
+ a = function() {x.action.shutdown();};
+ } else {
+ a = function() {x.action.stop();};
+ }
}
}
this.track.setAction(a);
--- sleepy/gui.ui~ 2009-10-18 14:06:12.000000000 +0200
+++ sleepy/gui.ui 2009-10-21 02:16:29.954417689 +0200
@@ -215,6 +215,11 @@
<string>Shutdown</string>
</property>
</item>
+ <item>
+ <property name="text">
+ <string>Amarok Stop</string>
+ </property>
+ </item>
</widget>
</widget>
<widget class="QLabel" name="infoDisabled">

Report

7 years ago

tmske

Thanks for the patch, I applied it with some minor changes.
I also added custom messages for each action.
If you have other requests you can always ask them and I'll see what I can do.

Report

7 years ago

ilpianista

Thanks!

Report

Supporters

Recent Donations

Be the first to donate
Filename Version Description Filetype Packagetype License Downloads Date Filesize Install
Score 54%
54.00 Likes
46 Dislikes

0 Supporters for sleepy (shutdown script):

Recent Donations:

Be the first to donate
show all
Details
version
0.9.3
updated Aug 23 2010
added Oct 18 2009
downloads
page views 256
support tmske
For The Product
sleepy (shutdown script)
5 - 10 - 25 - 50 - 100 - 200 - 500