seeking HOWTO inhibit screen saver from command-line
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
seeking HOWTO inhibit screen saver from command-line
I'd like to know (1) some command, or (2) some programming that will let me disable-enable the screen saver from a command line. More specifically, I'd like something that I can add to shell scripts.
While running a Gnome desktop, I open a console window and run a command. The command runs a spews to stdout because I want to watch things run. In spite of all of this "running" the screen-saver kicks thinking things are idle without key droppings or mouse droppings.
While I'm asking for help...
How can a script discover if it is running in a kernel console, or xterm-konsole, or backgrounded?
I'm assuming your system is using gnome-screensaver? If you can't find any documentation for cli control of the screensaver program itself (and I couldn't find any on my system) then you should be able to bludgeon it into submission with
Code:
killall -STOP gnome-screensaver
and to restart it afterwards, replace "STOP" with "CONT"
For your 2nd question, I'm not sure of a definitive answer, but the command "tty" will return something like "/dev/tty2" when running in a vt, and "/dev/pts/1" if running in a gui terminal or other non-vt environment.
I have searched for a solution to this problem but no luck. I am running FC 11 and out of the box gnome. At first the screensaver worked normally, shutting off the screen after 5 mins. Now it does not work. I found the following command line suggestion in the forums, and it looks like that may point to a problem -- the screensaver is inactive, but how to make it active? I am happy with command line, but have no idea what the command to use would be. I may be misunderstanding the term inactive, of course. Logically, the screensaver would have to be inactive if I am typing a command -- but the forum post where I saw this command showed "The screensaver is active" ??
home/rdn/Music% gnome-screensaver-command --query
The screensaver is inactive
The screensaver is not inhibited
I tried this command (from another post):
home/rdn/Music% killall -CONT gnome-screensaver
But the query returns the same thing as before.
The only thing I can think of that might be an issue is that using the "appearances" background facility I added a couple dozen pictures that I thought I might use as screen background. Not long after that I discovered that my screen did not go black after 5 mins as expected. Not sure this correlation has any causal meaning, however. I then tried various things, finally returning to the plain (blue) default. That seemed to fix it for a short while, then after a couple of days, the bad or non-behavior returned -- the screensaver does not work.
Any help will be appreciated. My system runs all the time, but I don't want the screen to be on all the time.
Much of the replies so far assume you're using gnome-screensaver (and maybe you are..) but just incase you're interested, and are using xscreensaver, try below:
To disable xscreensaver from commandline or script, do (sometimes you need to do this twice):
shell$ xscreensaver-command -exit
and to re-activate the screensaver and background it, do (assuming the default display of :0.0):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.