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

Disable Screensaver

157

Votes
159
2
Tags: dragon player dragon player dragon player
(comma "," separated)
Kryten2X4B
Registered Member
Posts
911
Karma
4
OS
Madman wrote:KDE doesn't do better-then-nothing stuff, because the devs are wise enough to know that if they implemented a better-then-nothing solution, a real solution wouldn't be made because the problem's, "fixed" (system-tray-transparency, anyone?)


Okay, a bad choice of words on my part. Still, "better than nothing" can mean many things. It can mean implement something half-assed to get users stop whining about something, OR it can mean first implement something but with some features missing to get started. KDE is certainly no stranger to the latter meaning.

Besides, I doubt people (users as well as devs) would consider a "stop screensaver from kicking in if in full-screen" a fix to this problem. A stop-gap measure at best.


OpenSUSE 11.4, 64-bit with KDE 4.6.4
Proud to be a member of KDE forums since 2008-Oct.
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS
bratwurst wrote:This is how Microsoft does it: Windows send a signal (WS_SYSCOMMAND/SC_SCREENSAVE) to the window that currently has focus. This signal is a question: Can I, Windows, turn off the screen please? The application has the right to answer "no you can't" and then windows won't. Think there where more signals like this. Seems like a good solution to me.


This is a typical windows solution, since it gives the application total power, authority, and responsibility to do whatever it wants and assumes that developers will both make the proper effort and act responsibly, while giving the user no choice in the matter. However, I do not think it is a good KDE or Linux solution which leaves the ultimate decision up to the user. I think using power profiles that users can customize to their liking is a much better solution. The application only says what it is doing in a general sense, and that determines the power profile that is set. This also allows things like processor usage, sleep mode, and other power-related settings to be set as well. Further, why only the program that has focus? In the days of multi-monitor setups and huge screens, you can't assume that the video you are watching will actually have focus.

Last edited by TheBlackCat on Thu Apr 16, 2009 1:49 pm, edited 1 time in total.


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
User avatar
Madman
Registered Member
Posts
593
Karma
1
OS
Kryten2X4B wrote:
TheBlackCat wrote:Perhaps phonon could report its status and powerdevil could listen for it and switch to and from the correct power profile (video or music) automatically.


That actually sounds like it could work. At least I hope it's as doable as it sounds :)


This is actually my favourite suggestion in this thread, especially considering that Phonon is the multimedia framework used by all apps.


Madman, proud to be a member of KDE forums since 2008-Oct.
User avatar
TheBlackCat
Registered Member
Posts
2945
Karma
8
OS
Madman wrote:This is actually my favourite suggestion in this thread, especially considering that Phonon is the multimedia framework used by all apps.


It is just an example. Other frameworks and apps could report their status in the same way (such as "playing video") and powerdevil (or any other power manager) could change its power profile in the same way. I assume this would be dbus-based. The good thing about Phonon is that application developers that use it do not have to worry about this themselves, the framework could handle it for them. Likewise mplayer and xine would probably handle this for all of their various front-ends. I am not sure if gstreamer can do the same or not but if it can it should.

The main thing is for the framework to do as much of the work as possible so individual application developers do not have to worry about it. The more people that have to implement this the more of a chance someone won't or will do it wrong or inconsistently. Covering Phonon, Xine, Mplayer, and Gstreamer frameworks will cover most popular multimedia applications, while VLC does not appear to be used as a back-end for something else much if at all so it could be done at the application-level.

Of course these are not KDE projects, unlike Phonon, so KDE developers do not have the authority to make them implement this, unlike Phonon which is a KDE project (which is why I focused on it). Although, as open-source projects KDE developers could provide the patches, or at least tell them how to do it themselves.

Last edited by TheBlackCat on Thu Apr 16, 2009 3:07 pm, edited 1 time in total.


Man is the lowest-cost, 150-pound, nonlinear, all-purpose computer system which can be mass-produced by unskilled labor.
-NASA in 1965
bratwurst
Registered Member
Posts
47
Karma
0
OS
[quote='TheBlackCat']
Perhaps phonon could report its status and powerdevil could listen for it and switch to and from the correct power profile (video or music) automatically.
[/quote]

Would this work for flash "movies" in the browser?
User avatar
david_edmundson
KDE Developer
Posts
359
Karma
1
OS
This (as far as I know) be in the Dragon code. If it isn't working then it's a bug.

KDE has a mechanism for surpressing the screensaver, which is called from the Dragonplayer code.

Dragonplayer also supresses suspend from kicking in. However Solid currently lacks a mechanism to disable turning off the screen power management (sometimes confused with a 'screensaver')

Edit: I can't remember if I backported the supsend inhinition to 4.2. It's certainly ready for 4.3

Last edited by david_edmundson on Fri Apr 17, 2009 11:24 am, edited 1 time in total.
mxttie
Registered Member
Posts
10
Karma
0
OS
Kryten2X4B wrote:It's strange that it isn't implemented already, but I have to wonder if the right place to implement it is in an individual app...somehow it feels like this is something that should be implemented system-wide if possible.


IIRC, in kde3, you can configure every corner of the screen to disable the screensaver if the mouse cursor is positioned there. This way the user has total control and the application doesn't need to implement anything (though it still can if it wants to, of course)

I guess this hasn't been ported yet (I didn't check)
vahid
Registered Member
Posts
32
Karma
0
RecoilUK wrote:I think it would be good if Dragon Player disabled the screensaver when playing a video.

Basically .kde/share/config has some rc files that control screen saver power management of monitor - upon update krunner needs to be restarted
(this is all done via automated script below which runs on crontab and disables - screensaver powermanagement whilst u watch listen to audio)
You can modify as you like

There is a section for audio then a section for video

The reason for the devision is I don't mind screen saver for audio - it means one extra press on remote control to get screen back - but if it locks it requires a password to allow remote to control again. this can be annoying if you have it set to every minute.

As a default setup i preusme powerdevil and kscreensaver are used:

feel free to remove config for krandtray and kpowersave they are there just incase you use different methods to control PM.

in your home folder open a shell
mkdir scripts
cd scripts
first do
env|grep DISPLAY (ensure the display number matches first line of script also update username to match your username and make sure home folder paths etc match up to your setup)
then

vi watching-film.sh
esc i [ insert mode copy paste below into it then :wq then chmod 755 ./watching-films.sh and follow crontab entry below]

[code]
#!/bin/sh


export DISPLAY=:0
username="YOUR_USERNAME";
home="/home/$username";
rcfile="$home/.kde/share/config/kscreensaverrc";
powerdevil="$home/.kde/share/config/powerdevilprofilesrc";
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
detected="$home/scripts/.audiorunning"
audio=`pgrep "(audacious|amarok|xmms|rhythmbox|exaile|banshee|juk)" -d1`
video=`pgrep "(mplayer|kplayer|kaffeine|totem|kmplayer|dragon)" -d1`

if [ $audio > 0 ]
then
LOCK=`cat $rcfile |grep "^Lock=true"|awk -F"^Lock=" '{print $2}'`
if [ "$LOCK" = "true" ]
then
echo "disabling screen lock"
ed -s $rcfile 0 ]
then
echo "checking Screensaver status";
#Disable kde-screensaver
ENABLED=`cat $rcfile |grep "^Enabled="|awk -F"^Enabled=" '{print $2}'`
if [ "$ENABLED" = "true" ]
then
ed -s $rcfile /dev/null

add above crontab entry and screen saver is now controlled via this script

thanks
vahid

Last edited by vahid on Mon Jun 22, 2009 10:24 pm, edited 1 time in total.
redada
Registered Member
Posts
3
Karma
0
OS
What about a more general appoach?

Like this one:

improve-idle-detec ... 39404.html

Greetings
redada
vahid
Registered Member
Posts
32
Karma
0
redada wrote:What about a more general appoach?

Like this one:

improve-idle-detec ... 39404.html

Greetings
redada


Yes but this does not fix the screensaver issue. powerdevil controls powemanagement which is different to screensaver settings or config.

I am currently using my own script and it does exactly what I want.
No power management for screen during films, no screen savers either.
During Music I get screensaver but no password.
And when there is no music or video the screen saver is fully on and protecting with a password.

Thats what I call my ideal setup and wrote script to represent this.
I have my reasons for it i.e. no password so I can still use remote
and if there is no music or video then surely it should be protected from any onlookers.

Simplez.
Also This has no requirements for audio/video software to develop plugins you can run independantly and add new/move applications from the two modes as you require.

This is currently working on latest kubuntu so if you are running
K Desktop Environment Version 4.2.2 then it should be work for you too -
vahid
Registered Member
Posts
32
Karma
0
also besides powerdevil there was previous methods that a user could control power management - just incase someone has messed with power management using krandtray or kpowertool run below script to disable them and use powerdevil


#!/bin/sh

kpowersave="$home/.kde/share/config/kpowersaverc";
krand="$home/.kde/share/config/kcmdisplayrc";

if test -e $krand
then
ed -s $krand 0 ]
then
ed -s $kpowersave <<EOF
$num1,$num1 d
w
q
EOF
echo "$kpowersave disabled specSsSettings=true removed"
fi
vahid
Registered Member
Posts
32
Karma
0
- updated first script to not make it confusing ignore this msg

Last edited by vahid on Mon Jun 22, 2009 10:25 pm, edited 1 time in total.
vahid
Registered Member
Posts
32
Karma
0
bratwurst wrote:[quote='TheBlackCat']
Perhaps phonon could report its status and powerdevil could listen for it and switch to and from the correct power profile (video or music) automatically.


Would this work for flash "movies" in the browser?
[/quote]

Well If you use my script

You can add npviewer.bin to list of video
video=`pgrep "(mplayer|kplayer|kaffeine|totem|kmplayer|dragon|npviewer.bin)" -d1`

to make sure this is the right name load up firefox - then load up youtube and load up a video then do as blow and find the end of command for first command running in my case it is npviewer.bin - this now stops screensaver and power mgmnt whilst u watch utube on firefox.... the script can be modified any app or process can be added..

ps auwx|grep flashplugin
nutter 7509 20.3 0.9 197008 38572 ? Sl 21:19 0:19 /usr/lib/nspluginwrapper/i386/linux/npviewer.bin --plugin /usr/lib/flashplugin-installer/libflashplayer.so --connection /org/wrapper/NSPlugins/libflashplayer.so/7459-2
nutter 7763 0.0 0.0 7528 904 pts/2 R+ 21:20 0:00 grep flashplugin
nutter@muttley:~/scripts$ pgrep npviewer.bin
7509
bruno
KDE Developer
Posts
40
Karma
0
OS
mxttie wrote:IIRC, in kde3, you can configure every corner of the screen to disable the screensaver if the mouse cursor is positioned there. This way the user has total control and the application doesn't need to implement anything (though it still can if it wants to, of course)

I guess this hasn't been ported yet (I didn't check)


In KDE 4, it's "System settings" -> "Desktop" -> "Screen saver" -> "Advanced settings"
http://imagebin.ca/view/J2Z6FX.html

Last edited by bruno on Fri Jun 19, 2009 8:58 pm, edited 1 time in total.


bruno, proud to be a member of KDE forums since 2008-Oct.
andre_orwell
Registered Member
Posts
181
Karma
1
Fantastic and useful thread. It is a perennial idea so its about time it was implemented.

Is it just about power management / screen saver and video playback though? This problem arises also when giving presentations (as anticipated by the "presentation" profile in power devil). We are all too familiar with windows and messenger notifications popping up at inappropriate times when running windows.


andre_orwell, :-[


Bookmarks



Who is online

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