SleepyKNCH

Amarok 1.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on git.opendesktop.org

0
Score 54%
Description:

Amarok script for suspend, hibernate, shutdown KDE4 and pausing, stopping or closing Amarok according to playlist settings or elapsed time.
This script is based on the \"Sleepy\" script 0.9.3 by Thomas Coopman (http://kde-apps.org/content/show.php/sleepy+%28shutdown+script%29?content=113946).
It was edited for usage on KDE4 with qdbus (without HAL). The GUI was slightly reworked (see the screenshot). Besides the translations were removed.


ilpianista

7 years ago

Thanks!

...but why you didn't submit your patches to the original sleepy?

Report

C

KNCH

7 years ago

You're welcome!

Well, I haven't done it because it was only changed for using without HAL, that isn't a real need for everyone who uses the script. And the GUI was changed (just a little bit though), that also wouldn't be useful for everyone.

Here is the patch for "action.js" for using the script without HAL:

Quote:
--- sleepy/action.js 2011-06-21 16:55:44.711041919 +0200
+++ sleepyKNCH/action.js 2011-06-21 03:58:55.242503560 +0200
@@ -12,6 +12,8 @@
//
//You should have received a copy of the GNU General Public License
//along with Amarok. If not, see <http://www.gnu.org/licenses/>.
+//
+// edited by KNCH

Importer.loadQtBinding( "qt.core" );

@@ -22,22 +24,22 @@
this.execute = execute;
this.pause = pause;
this.stop = stop;
- this.quit = quit;
- this.turnOffScreen = turnOffScreen;
+ this.quit = quit;
+ this.turnOffScreen = turnOffScreen;
}

function suspend() {
- var suspend = "qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend 1";
+ var suspend = "qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.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 org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.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 org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 1 2 2";
this.execute(shutdown);
}

Report

product-maker extra Jun 21 2011

File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
0.1
updated Jun 21 2011
added Jun 20 2011
downloads today
0
page views today 1
System Tags addon