This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Feature Request: Lock Screen w/ amaroK

Tags: None
(comma "," separated)
Dan
Karma
0
I\'d like to see a feature that allows you to lock your screen(s) with your amaroK window. This would let you lock down your computer but still be able to control your tunes.
hurra
Karma
0
Hi

First, sorry for my bad english.

I have also a feature request, that goes in the same direction.

When locking the screen (rightclick on desktop, lock) amarok should be able to pause playback. On delocking, amarok should continue to resume playback. This needs a possibility to deactivate this fuction (in the options).

My kopete does this:
screen locked: contact status is away
when i\'m back and and enable my desktop, kopete automatically changes my connection status to online.

Thanks.

Cu Hurra
Dan
Karma
0
Another, probably easier, way this could be done is to make a screensaver that is actually an OSD style control for amaroK... just gives you the name of the current song, maybe an album cover, and play/pause/stop/next/previous buttons.
mortiferus
Registered Member
Posts
74
Karma
0
hurra wrote:
When locking the screen (rightclick on desktop, lock) amarok should be able to pause playback. On delocking, amarok should continue to resume playback. This needs a possibility to deactivate this fuction (in the options).

Hi, i mixed together a solution to do this a while back. It dont work in the "script manager", so you wil have to run it manual. Had actualy writen a post about it to get help to fix it, but had switched keboard layout, and writing the message took me 45 minutes, so when I managed to delete it before I posted it I gave up.
Now annyway, this is the code. You need perl. Save this in a file and run
[code:1]
perl FILE
[/code:1]
then try to lock the screen, it should pause amarok.
The code:
[code:1]
#!/usr/bin/perl

my $blanked = 0;
open (IN, "xscreensaver-command -watch |"«»);
while () {
if (m/^(BLANK|LOCK)/)
{ if (!$blanked) {
open (STATUS, "dcop amarok player status |"«»);
if (==2)
{ system "dcop amarok player pause";
$blanked = 1;
}
}
}
elsif ($blanked==1 && m/^UNBLANK/)
{ system "dcop amarok player pause";
$blanked = 0;
}
}
[/code:1]
hurra
Karma
0
Thanks.

Your script has a failure in line 9, it hast to be $blanked==2

hm, now i only need to kown, how to get the status of my screen.

Thanks

Bye
hurra
Karma
0
Ahh B) B)

Got it now with bash:
[code:1]
#!/bin/bash
while [ true ];
do
b1=$(dcop kdesktop KScreensaverIface isBlanked)
if [ \"true\" = $b1 ]; then

$(dcop amarok player pause)


b2=$(dcop kdesktop KScreensaverIface isBlanked)
while [ $b2 = \"true\" ];
do
b2=$(dcop kdesktop KScreensaverIface isBlanked)
done

$(dcop amarok player pause)

fi
sleep 1
done
[/code:1]


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], Sogou [Bot], Yahoo [Bot]