1 |
On Thu, May 11, 2017 at 04:19:28PM -0700, Daniel Campbell wrote |
2 |
> On 05/10/2017 04:08 PM, Walter Dnes wrote: |
3 |
> > On Wed, May 10, 2017 at 03:36:05PM -0400, Jonathan Callen wrote |
4 |
> > |
5 |
> >> Additionally, "setterm --blank force" turns the console off immediately. |
6 |
> > |
7 |
> > Thank you; that's exactly what I was looking for. My script |
8 |
> > ~/bin/dark now reads... |
9 |
> > |
10 |
> > #!/bin/bash |
11 |
> > sleep 1 && xset -display :0.0 dpms force off |
12 |
> > setterm --blank force |
13 |
> > |
14 |
> > ...so I can execute "dark" in either X or a true text console, and it |
15 |
> > works in both cases. |
16 |
> > |
17 |
> |
18 |
> If I may suggest an enhancement, you might want to probe the |
19 |
> environment the script is running in so that only the relevant command |
20 |
> gets run; unless of course you really do want everything off at once |
21 |
> regardless of whether X is running.. |
22 |
|
23 |
Isn't that the whole point of excercise? If I want to turn off the |
24 |
display, I want to turn off the display. BTW, I've discovered a problem. |
25 |
|
26 |
sleep 1 && xset -display :0.0 dpms force off |
27 |
|
28 |
...allows to bring back the display by tapping any key. I prefer |
29 |
{SHIFT} because it doesn't do anything by itself. But the command... |
30 |
|
31 |
setterm --blank force |
32 |
|
33 |
...can't be awoken from in a text console. However, if X is running in |
34 |
tty7, I can {CTRL}{ALT}{F7} and X comes up. Then I can {CTRL}{ALT}{F1} |
35 |
to get back to a text console in tty1... weird. |
36 |
|
37 |
-- |
38 |
Walter Dnes <waltdnes@××××××××.org> |
39 |
I don't run "desktop environments"; I run useful applications |