Re: [gentoo-user] Re: How do I turn off text console screen in software?

2017-05-13 Thread Miroslav Rovis
On 170511-19:57-0400, Walter Dnes wrote:
> On Thu, May 11, 2017 at 04:19:28PM -0700, Daniel Campbell wrote
> > On 05/10/2017 04:08 PM, Walter Dnes wrote:
> > > On Wed, May 10, 2017 at 03:36:05PM -0400, Jonathan Callen wrote
> > > 
> > >> Additionally, "setterm --blank force" turns the console off immediately.
> > > 
> > >   Thank you; that's exactly what I was looking for.  My script
> > > ~/bin/dark now reads...
> > > 
> > > #!/bin/bash
> > > sleep 1 && xset -display :0.0 dpms force off
> > > setterm --blank force
> > > 
> > > ...so I can execute "dark" in either X or a true text console, and it
> > > works in both cases.
> > > 
> > 
> > If I may suggest an enhancement, you might want to probe the
> > environment the script is running in so that only the relevant command
> > gets run; unless of course you really do want everything off at once
> > regardless of whether X is running..
> 
>   Isn't that the whole point of excercise?  If I want to turn off the
> display, I want to turn off the display.  BTW, I've discovered a problem.
> 
> sleep 1 && xset -display :0.0 dpms force off
> 
> ...allows to bring back the display by tapping any key.  I prefer
> {SHIFT} because it doesn't do anything by itself.  But the command...
> 
> setterm --blank force
> 
> ...can't be awoken from in a text console.  However, if X is running in
> tty7, I can {CTRL}{ALT}{F7} and X comes up.  Then I can {CTRL}{ALT}{F1}
> to get back to a text console in tty1... weird.
Same here.

> -- 
> Walter Dnes 
> I don't run "desktop environments"; I run useful applications
> 

Good tips in this thread!

Regards!
-- 
Miroslav Rovis
Zagreb, Croatia
https://www.CroatiaFidelis.hr


signature.asc
Description: Digital signature


Re: [gentoo-user] Re: How do I turn off text console screen in software?

2017-05-11 Thread Walter Dnes
On Thu, May 11, 2017 at 04:19:28PM -0700, Daniel Campbell wrote
> On 05/10/2017 04:08 PM, Walter Dnes wrote:
> > On Wed, May 10, 2017 at 03:36:05PM -0400, Jonathan Callen wrote
> > 
> >> Additionally, "setterm --blank force" turns the console off immediately.
> > 
> >   Thank you; that's exactly what I was looking for.  My script
> > ~/bin/dark now reads...
> > 
> > #!/bin/bash
> > sleep 1 && xset -display :0.0 dpms force off
> > setterm --blank force
> > 
> > ...so I can execute "dark" in either X or a true text console, and it
> > works in both cases.
> > 
> 
> If I may suggest an enhancement, you might want to probe the
> environment the script is running in so that only the relevant command
> gets run; unless of course you really do want everything off at once
> regardless of whether X is running..

  Isn't that the whole point of excercise?  If I want to turn off the
display, I want to turn off the display.  BTW, I've discovered a problem.

sleep 1 && xset -display :0.0 dpms force off

...allows to bring back the display by tapping any key.  I prefer
{SHIFT} because it doesn't do anything by itself.  But the command...

setterm --blank force

...can't be awoken from in a text console.  However, if X is running in
tty7, I can {CTRL}{ALT}{F7} and X comes up.  Then I can {CTRL}{ALT}{F1}
to get back to a text console in tty1... weird.

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



Re: [gentoo-user] Re: How do I turn off text console screen in software?

2017-05-11 Thread Daniel Campbell
On 05/10/2017 04:08 PM, Walter Dnes wrote:
> On Wed, May 10, 2017 at 03:36:05PM -0400, Jonathan Callen wrote
> 
>> Additionally, "setterm --blank force" turns the console off immediately.
> 
>   Thank you; that's exactly what I was looking for.  My script
> ~/bin/dark now reads...
> 
> #!/bin/bash
> sleep 1 && xset -display :0.0 dpms force off
> setterm --blank force
> 
> ...so I can execute "dark" in either X or a true text console, and it
> works in both cases.
> 

If I may suggest an enhancement, you might want to probe the environment
the script is running in so that only the relevant command gets run;
unless of course you really do want everything off at once regardless of
whether X is running..

-- 
Daniel Campbell - Gentoo Developer
OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net
fpr: AE03 9064 AE00 053C 270C  1DE4 6F7A 9091 1EA0 55D6



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] Re: How do I turn off text console screen in software?

2017-05-10 Thread Walter Dnes
On Wed, May 10, 2017 at 03:36:05PM -0400, Jonathan Callen wrote

> Additionally, "setterm --blank force" turns the console off immediately.

  Thank you; that's exactly what I was looking for.  My script
~/bin/dark now reads...

#!/bin/bash
sleep 1 && xset -display :0.0 dpms force off
setterm --blank force

...so I can execute "dark" in either X or a true text console, and it
works in both cases.

-- 
Walter Dnes 
I don't run "desktop environments"; I run useful applications



[gentoo-user] Re: How do I turn off text console screen in software?

2017-05-10 Thread Jonathan Callen
On 05/10/2017 12:59 PM, R0b0t1 wrote:
> On Wed, May 10, 2017 at 9:03 AM, Walter Dnes  wrote:
>>   I'd prefer to avoid hitting the monitor display on/off too often.  In
>> an xterm, the script...
>>
>> #!/bin/bash
>> sleep 1 && xset -display :0.0 dpms force off
>>
>> ...shuts the screen off.  Is there an equivalant command for a text
>> console (e.g. where you end up if you hit CTRL-ALT-F1)?
>>
>> --
>> Walter Dnes 
>> I don't run "desktop environments"; I run useful applications
>>
> 
> `setterm -blank VALUE` where VALUE is specified in minutes. A value of
> zero disables blanking. You can also add "consoleblank=0" to your
> kernel's command line. It's probably worth looking at the other
> `setterm` options.
> 
> You can read /sys/module/kernel/parameters/consoleblank to see if your
> changes applied properly.
> 
> 


Additionally, "setterm --blank force" turns the console off immediately.

-- 
Jonathan Callen



signature.asc
Description: OpenPGP digital signature