[MPlayer-users] Disable KDE screensaver

Paulo Rogerio Sabini progerio at ime.uerj.br
Sun Mar 10 19:46:02 CET 2002


	I see people asking how stop KDE screensaver.
	I am using KDE 2.1 and the script below to disable KDE
screensaver
and the DPMS during DVD playback.

	In command line I put an alias and in KDE menu
entry (usr/share/applnk/Multimedia/mplayer.desktop)
I put:

	ash -c 'energy stop; artsshell terminate; mplayer -gui -fs
-framedrop -skin phony -slang pt,en -vo xv -ao sdl -stereo 0; kcminit
arts; energy start'

	That stop the screensaver/DPMS and the arts sound server also.

	Paulo

####################################################################################

#!/bin/tcsh -f

##
## A little script to stop KDE screensaver/DPMS.
##

if ("`pidof X`" == "") exit

switch ("$1")
  case "stop":

    ##
    ## If DPMS control is enabled stop it.
    ##

    if (`xset q | egrep -ic "DPMS is Enabled"`) then
        xset -dpms
    endif

    ##
    ## If KDE screensaver enabled stop it.
    ##

    if (`dcop kdesktop KScreensaverIface isEnabled`) then
        echo "/Enabled=/ s/Enabled=true/Enabled=false/\nwq" | ed -s
~/.kde/share/config/kdesktoprc >& /dev/null
        dcop kdesktop KScreensaverIface configure
    endif
breaksw

  case "start":

    ##
    ## If DPMS control is disabled start it.
    ##

    if (!(`xset q | egrep -ic "DPMS is Enabled"`)) then
       xset +dpms
    endif

    ##
    ## If KDE screensaver disabled start it.
    ##

    if (!(`dcop kdesktop KScreensaverIface isEnabled`)) then
      echo "/Enabled=/ s/Enabled=false/Enabled=true/\nwq" | ed -s
~/.kde/share/config/kdesktoprc>& /dev/null
      dcop kdesktop KScreensaverIface configure
    endif
breaksw

default:

    echo "Usage: $0:t"' [start/stop "energy save controls"]\n'

endsw

##
## Now we print the current situation.
##

echo "Current situation now is:"

if (`dcop kdesktop KScreensaverIface isEnabled`) then
        echo "\tKDE screensaver is enabled:"
        echo "\t\t"`egrep -i "timeout" ~/.kde/share/config/kdesktoprc`
else
        echo "\tKDE screensaver is disabled."
endif

if (`xset q | egrep -ic "DPMS is Enabled"`) then
        echo "\tDPMS control is enabled:"
        echo "\t\t"`xset q | awk '{if($0 ~ "DPMS is Enabled"){print
gensub(": ","=","g",a)}; a=$0}'`
else
        echo "\tDPMS control is disabled."
endif


###########################################################################################################
-- 

	As melhores coisas da vida são gratuitas.O pôr do sol, a lua cheia e, por que não, o software livre.

	<Usuário LINUX>





More information about the MPlayer-users mailing list