PDA

View Full Version : shut off/adjust screen saver gnome 3 from terminal?


Stratus_ss
12-29-11, 07:22 AM
So I have been poking around trying to figure out how to, if the screen saver kicks in, turn it off from the terminal.

I have found

gnome-screensaver-command -d


However this does not seem to work turning off the default gnome 3 screen saver.

I tested this by doing a while true loop.

i.e.


while true; do sleep 65 && echo "poking the screen saver" && gnome-screensaver-command -d; done


I set the screen saver to come on after 1 minute then I waited. I let it go for 3 iterations but the screen saver did not turn off.

I tried turning off the lock screen and re-running the experiment. I am familiar with gnome-shell extensions such as presentation mode but I am trying to find out how to do this from the CLI

As an alternative, I could inject code to the releveant place if I knew where that was.... I was looking for a file which stored the timeout so that I could change it but I couldnt find any.

Anyone have any guesses as how to proceed?

Shelnutt2
12-29-11, 07:31 AM
Which version of gnome 3 are you running? 3, 3.2 or 3.3?


Finally, you can no longer customize the screensaver in GNOME 3. When your screen is locked all you get is a black screen with the clock, a lock symbol and your name at the top of the screen. There are plans to remove gnome-screensaver in GNOME 3.2 and putting its functionality partially in the GNOME Shell and the remainder in gnome-session or gnome-settings-daemon. It may then be possible to write a themed Clutter-based screensaver extension for GNOME Shell.

https://mail.gnome.org/archives/gnome-shell-list/2011-March/msg00340.html

Ubuntu might have what you are looking for in this blueprint (https://blueprints.launchpad.net/ubuntu/+spec/desktop-o-screensaver).

Stratus_ss
12-29-11, 08:22 AM
I am running gnome 3.2 in fallback mode Mint 12.

Stratus_ss
12-29-11, 01:38 PM
Here is what I hacked together.

Basically it turns off the screen saver via xset, when "flash" is detected in the ps list


#!/usr/bin/python
import time
import os
import sys

#Force the infinate loop
n = 0

while n != 1:
#check to see if flash shows up in the process loop
flash = int(os.popen("ps aux |grep flash |grep -v grep|wc -l").read())
if flash != 1:
print "flash not running turning on screen saver"
os.system("xset +dpms")
else:
#if flash is running, turn off the screen saver, assuming that a video is playing
print "flash running...disabling screen saver"
os.system("xset -dpms")
time.sleep(50)



EDIT: I guess I should say why I wanted this. Basically, I don't want to have to remember to put the computer into "presentation" mode when I am watching something. Instead I want to have my screensaver act normal when no flash is detected, but as soon as flash is loaded, stop the screensaver from running