LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-26-2009, 02:37 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Rep: Reputation: 86
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?

Thanks,
~~~ 0;-Dan
 
Old 11-26-2009, 04:30 PM   #2
lwasserm
Member
 
Registered: Mar 2008
Location: Baltimore Md
Distribution: ubuntu
Posts: 184

Rep: Reputation: 41
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.

Last edited by lwasserm; 11-26-2009 at 04:32 PM.
 
Old 12-01-2009, 07:52 AM   #3
rdnelson
LQ Newbie
 
Registered: Aug 2003
Location: Princeton, NJ, USA
Distribution: Fedora, Centos, Ubuntu
Posts: 14

Rep: Reputation: 0
Question Gnome screensaver doesn't work

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.

Roger
 
Old 12-01-2009, 12:10 PM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,776

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
search 'screensaver inhibit' Among the hits:
https://wiki.ubuntu.com/InhibitingGnomeScreensaver
 
Old 12-01-2009, 12:28 PM   #5
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
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):

shell$ xscreensaver -display :0.0 -nosplash &

Sasha
 
Old 01-16-2013, 03:46 AM   #6
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
Quote:
Originally Posted by gnashley View Post
search 'screensaver inhibit' Among the hits:
https://wiki.ubuntu.com/InhibitingGnomeScreensaver
The same applies for gnome-shell? (it's annoying when listening to music through HDMI and the PM turns-off the screen, turning of TV sound - and there is no way I know to disable it via GUI)
 
Old 01-16-2013, 06:09 AM   #7
fbobraga
Member
 
Registered: Jul 2010
Location: São Paulo - Brasil
Distribution: Debian 7 / Crunchbang 11
Posts: 229

Rep: Reputation: 41
Quote:
Originally Posted by fbobraga View Post
The same applies for gnome-shell? (it's annoying when listening to music through HDMI and the PM turns-off the screen, turning of TV sound - and there is no way I know to disable it via GUI)
Found a simple extension that may do the trick: https://extensions.gnome.org/extensi...nhibit-applet/
 
  


Reply

Tags
fc11, fedora, gnome, screensaver, software


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
howto add a mouse on the command line? Fred Caro Linux - Newbie 4 12-29-2008 01:50 PM
Screen saver as a command xennetwork Linux - Desktop 2 07-19-2007 06:34 AM
Blank Screen after Suse Boot - HowTo boot from grub to command line benco420 Linux - Newbie 3 02-13-2005 06:50 AM
pppd from command line...howto Crasherz Linux - Networking 1 03-05-2004 11:52 AM
Seeking command line help digsby0007 Linux - Newbie 2 04-23-2003 03:53 PM


All times are GMT -5. The time now is 08:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration