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)
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, :-[
vahid
Registered Member
Posts
32
Karma
0
andre_orwell wrote: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.


Hi Andre
Well

ed -s $powerdevil <<EOF
g/^DPMSEnabled=true/s/^DPMSEnabled=true/DPMSEnabled=false/g

This means all DPMSEnabled across the powerdevil config file are DISABLED OR ENABLED depending on what is running.
So yes all modes are changed, the only down side is if this is a laptop and is running on battery then the powersave profile also gets affected.

I think one fix is to work out when powersave mode is on and disable script.

If you are using a specific application during your presentation add the application name to the list of video for no screensaver/powermanagement.
Below is example of no Audio/video running DPMS is enabled I then start kaffeine then run the script manually and after checking powerdevilprofilerc all DPMSEnabled= false.

:~/.kde/share/config# grep -B1 DPMSEnabled powerdevilprofilesrc
[Aggressive Powersave]
DPMSEnabled=true
--
[Performance]
DPMSEnabled=true
--
[Powersave]
DPMSEnabled=true
--
[Presentation]
DPMSEnabled=true
--
[Xtreme Powersave]
DPMSEnabled=true
:~/.kde/share/config# exit
:~$ kaffeine &
[1] 32714

[1]+ Done kaffeine


~$ /home/USER/scripts/watching-film.sh
checking Screensaver status
Lock=false
/home/USER/.kde/share/config/kscreensaverrc disabled
DPMSEnabled=false
/home/USER/.kde/share/config/powerdevilprofilesrc disabled DPMSEnabled=false
nohup: ignoring input and appending output to `nohup.out'

:~/.kde/share/config# grep -B1 DPMSEnabled powerdevilprofilesrc
[Aggressive Powersave]
DPMSEnabled=false
--
[Performance]
DPMSEnabled=false
--
[Powersave]
DPMSEnabled=false
--
[Presentation]
DPMSEnabled=false
--
[Xtreme Powersave]
DPMSEnabled=false


Last edited by vahid on Tue Jun 23, 2009 1:18 pm, edited 1 time in total.
andre_orwell
Registered Member
Posts
181
Karma
1
I think the point I was trying to make was that this is not just about power management. It is about preventing *any* other program from interfering with the display, sound etc when an application is running in a presentation mode (typically full-screen).

I'm not sure if KDE suffers from this the way windows does as I am typically stuck using windows for presentations (at work).


andre_orwell, :-[
vahid
Registered Member
Posts
32
Karma
0
andre_orwell wrote:I think the point I was trying to make was that this is not just about power management. It is about preventing *any* other program from interfering with the display, sound etc when an application is running in a presentation mode (typically full-screen).

I'm not sure if KDE suffers from this the way windows does as I am typically stuck using windows for presentations (at work).


Yep KDE Does suffer but hey guess what I have written a hack .. and I have been testing and it works..
Please visit Forum topic on automating knotify4 notifications


As for windows Ahem I don't use it, my suggestion is to have a look at process table maybe using command line somthing like fprocess and then exporting result to a notepade

fport.exe > c:result1.txt
then when notification occures try running it during notification just incase its a process that gets launched .. I am really unsure maybe its an active process on the process table and it can get killed off

Last edited by vahid on Tue Jun 23, 2009 4:20 pm, edited 1 time in total.
User avatar
david_edmundson
KDE Developer
Posts
359
Karma
1
OS
Dragon does try and disable screesaver, calling function seems not to work anymore. I'm not sure this is actual brainstorm material.

Follow here:
https://bugs.kde.org/show_bug.cgi?id=181585
andre_orwell
Registered Member
Posts
181
Karma
1
I don't think whether a particular application addresses this issue is the real topic of this thread any more. Rather it has been suggested that the application should not manage this task.

managing windows in unix has traditionally been the role of the window manager. Getting applications to individually block screen savers and the like is a bad approach (and very MS-like) for a number of reasons:
- it requires application developers to know about and test the interaction of their program with lots of other desktop stuff
- it doesn't allow modification of window management policy across *all* running apps

Thus it is a quick and simple fix for the DE (nothing to do) but creates a lot of work for a lot of other people. (definitely MS-like).

The WM/DE should be able to set policy WRT how notifications and power-mangement and screen-savers and possibly other tasks interact with applications based on visible attributes of the applications such as whether an app is running in full-screen mode.


andre_orwell, :-[


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], Sogou [Bot]