[Solved]Howto screen blank on command? (NOT automatically)

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

[Solved]Howto screen blank on command? (NOT automatically)

#1 Post by jtwdyp »

I use either slacko 5.6 or precise 5.7.1 depending on which flash drive I boot.
I don't like time based screen blanking. Though the ability to put a command on a hot key to
blank the screen instantly on command would be nice...

I Frequently I use my laptop as a hulu or youtube source for my tv. When I do so. it needs to
play (unattended) for hours at a time. I know I can use pupx to stop the screen saver on a per
session basis. I'm going to experiment with a script in /root/Startup containing:

Code: Select all

xset s off
Or maybe

Code: Select all

xset s off -dpms
Which should work for that part. But is there a command that would do the screen blanking on
demand? (preferably without reactivating the automatic screen saving function.) Something I
could put in a script along with something to spindowm the harddrive? I'd like to avoid a
full "suspend" though, because I'd like to do this without severing the wlan connection.
Last edited by jtwdyp on Tue 07 Jan 2014, 05:04, edited 1 time in total.
[color=brown][size=67]
--
JtWdyP

[/size][/color]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

xset dpms force off
sould come up with mouse or keyboard...not sure if it recommences auto blanking...

hdparm -S 12 /dev/sdx
..spindown after 1 minute.... n times 5....

mike

User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#3 Post by jtwdyp »

mikeb wrote:xset dpms force off
sould come up with mouse or keyboard...not sure if it recommences auto blanking...
Works great... And quick empirical testing says that according to the screen saver check box in the pupX gui, it doesn't re-enable what

Code: Select all

xset s off -dpms
has disabled... :D
hdparm -S 12 /dev/sdx
..spindown after 1 minute.... n times 5....
This also works, at least for any prenamed hard drive(s)

But since my Puppy's are all on portable flash drives I can't be sure how many drives etc... might be in the next machine I plug my fash drive into. So I'd want to somehow search for "x" Do you know if this hdparm command can adversly affect anything fdisk would call a "Disk" ???

IE would this kludge be safe???

Code: Select all

#!/bin/bash
# ParkEm root script to force spindown on all found harddrives
#
# WARNING: Untested code! 

for Parkit in $(fdisk -l |grep "Disk /dev/[hs]d[a-z]:") 
do
  	Parkit=$(echo $Parkit|cut -f1 -s -d:)
 	case $Parkit in
		'/'*)hdparm -S 12 $Parkit;;
	esac
done
[color=brown][size=67]
--
JtWdyP

[/size][/color]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#4 Post by mikeb »

As far as my limited knowledge goes anything to which the command is meaningless to would be ignored. (perhaps add a 2>/dev/null)

Assumes of course that anything that can be spun down after the time period will be....... It sometimes annoys file sharing that's all but not destructivly.

Note that hdparm DOES have some low level commands that can cause upset so careful with your spelling and syntax and CaSe.

mike

User avatar
jtwdyp
Posts: 137
Joined: Fri 04 Oct 2013, 10:48

#5 Post by jtwdyp »

mikeb wrote:As far as my limited knowledge goes anything to which the command is meaningless to would be ignored. (perhaps add a 2>/dev/null)
Hmmn nah, If I do this it will be in the same script as the

Code: Select all

xset dpms force off
command which would normally be called with something like

Code: Select all

<Key mask="SC" key="End">exec:/root/bin/blanknow</Key>
So I doubt any error messages will get to clutter up anything anyway...
Assumes of course that anything that can be spun down after the time period will be....... It sometimes annoys file sharing that's all but not destructivly.
Not to worry, if it's my puppy key that's been booted, file sharing won't be an issue. I'm thinking that as long as It won't hurt flash and/or solid state drives to be told by hdparm to spin down this way, I'm probably good to go with it...
Note that hdparm DOES have some low level commands that can cause upset so careful with your spelling and syntax and CaSe.
I'm guessing I wouldn't like "-s" here...

Not to worry, copy/paste is my friend.

Thanks
[color=brown][size=67]
--
JtWdyP

[/size][/color]

Post Reply