Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/examples/apm * Add some cut&paste ready commands for i...
details: https://anonhg.NetBSD.org/src/rev/a00c96bebf92
branches: trunk
changeset: 488113:a00c96bebf92
user: hubertf <hubertf%NetBSD.org@localhost>
date: Sun Jun 18 16:16:34 2000 +0000
description:
* Add some cut&paste ready commands for installing this
* Move audioplay to a shell function, to have one location where to
change the noise-making
* use /etc/rc.d/dhclient instead of doing it manually
* when going line->battery and vice versa, adjust idle timeouts of
harddisk (atactl), and add noatime,nodevmtime mount options.
Inspired by htdocs/Documentation/power-mgmt/
diffstat:
share/examples/apm/script | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diffs (88 lines):
diff -r 03d27d2029d4 -r a00c96bebf92 share/examples/apm/script
--- a/share/examples/apm/script Sun Jun 18 13:40:41 2000 +0000
+++ b/share/examples/apm/script Sun Jun 18 16:16:34 2000 +0000
@@ -1,12 +1,19 @@
#!/bin/sh
#
-# $NetBSD: script,v 1.2 2000/06/01 21:54:54 gmcgarry Exp $
+# $NetBSD: script,v 1.3 2000/06/18 16:16:34 hubertf Exp $
#
#
# Link this script to /etc/apm/{suspend,standby,resume,line,battery}
# to play some sounds on suspend/resume, and enable/shutdown the
-# network card. See apmd(8) for more information.
+# network card:
+#
+# mkdir /etc/apm
+# cp script /etc/apm/suspend
+# cd /etc/apm
+# for i in standby resume line battery ; do ln suspend $i ; done
+#
+# See apmd(8) for more information.
#
@@ -20,44 +27,54 @@
if=ne0
+noise() {
+ audioplay -q -f -s 22050 -c 1 $1
+}
+
case $0 in
*suspend)
logger 'Suspending...'
- audioplay -q -f -s 22050 -c 1 $S/KDE_Window_UnMaximize.wav
+ noise $S/KDE_Window_UnMaximize.wav
# In case some NFS mounts still exist - we don't want them to hang:
umount -a -t nfs
umount -a -f -t nfs
ifconfig $if down
- kill `ps -auxwww | grep dhclient | awk '{print $2}'`
+ sh /etc/rc.d/dhclient stop
logger 'Suspending done.'
;;
*standby)
logger 'Going to standby mode ....'
- audioplay -q -f -s 22050 -c 1 $S/KDE_Window_UnMaximize.wav
+ noise $S/KDE_Window_UnMaximize.wav
# In case some NFS mounts still exist - we don't want them to hang:
umount -a -t nfs
umount -a -f -t nfs
ifconfig $if down
- kill `ps -auxwww | grep dhclient | awk '{print $2}'`
+ sh /etc/rc.d/dhclient stop
logger 'Standby done.'
;;
*resume)
logger Resuming...
- audioplay -q -f -s 22050 $S/KDE_Startup.wav
- dhclient $if
+ noise $S/KDE_Startup.wav
+ sh /etc/rc.d/dhclient start
# mount /home
# mount /data
logger 'Resuming done.'
;;
*line)
- # audioplay -q -f -s 22050 -c 1 $S/KDE_Window_DeIconify.wav
+ # Running on power line, not battery...
+ # noise $S/KDE_Window_DeIconify.wav
+ mount -u -o atime,devmtime -a
+ atactl wd0 setidle 0
;;
*battery)
- # audioplay -q -f -s 22050 -c 1 $S/KDE_Window_DeIconify.wav
+ # Running on battery...
+ # noise $S/KDE_Window_DeIconify.wav
+ mount -u -o noatime,nodevmtime -a
+ atactl wd0 setidle 5
;;
esac
Home |
Main Index |
Thread Index |
Old Index