summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-16 16:33:36 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-16 16:33:36 -0500
commite802a8c71ed3a2f696181d69b0feca80b5aba06f (patch)
treef6c5b04eb632138ffdaf08f4534411f452ae365a /pm
parent4fe96950186e616db17767ce78690f7b82231a51 (diff)
Consolidated console save/restore code.
Instead of having console switch/restore logic spread out all over the place, have 00clear perform all our console switching.
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in4
-rwxr-xr-xpm/sleep.d/00clear9
2 files changed, 8 insertions, 5 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index c14e534..2c97848 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -34,7 +34,7 @@ NX=253
DX=252
PM_FUNCTIONS="$PM_UTILS_LIBDIR/functions"
# Use c sort order
-export LC_COLLATE=C
+LC_COLLATE=C
[ -f "${PM_UTILS_LIBDIR}"/defaults ] && . "${PM_UTILS_LIBDIR}"/defaults
@@ -92,8 +92,6 @@ take_suspend_lock()
remove_suspend_lock()
{
- local curr_vt=$(fgconsole)
- [ "$curr_vt" = "$VT" ] || chvt "$VT"
rm -rf "${STORAGEDIR}"
release_lock "pm-utils.lock"
}
diff --git a/pm/sleep.d/00clear b/pm/sleep.d/00clear
index a0c5081..217d8db 100755
--- a/pm/sleep.d/00clear
+++ b/pm/sleep.d/00clear
@@ -4,10 +4,15 @@
case "$1" in
hibernate|suspend*)
- TERM=linux openvt -w -s -f -c 63 -- clear >/dev/null 2>&1
+ fgconsole |savestate console
chvt 63
+ TERM=linux clear
+ ;;
+ thaw|resume)
+ state_exists console || exit 1
+ chvt $(restorestate console)
+ deallocvt 63
;;
- thaw|resume) chvt 1 ;;
*)
;;
esac