summaryrefslogtreecommitdiff
path: root/pm/sleep.d/00clear
blob: 47a2c858626df168c95657e5eac6435cc9fdbead (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Ensure we eare in text mode by switching to an unused vt.
# Also avoids lots of ghastly suspend/resume errors due to trying
# to suspend/resume while running in X.

. "${PM_FUNCTIONS}"

case "$1" in
	hibernate|suspend)
		fgconsole |savestate console
		chvt 63
		;;
	thaw|resume) 
		state_exists console || exit 1
		chvt $(restorestate console) 
		deallocvt 63
		;;
	*)
		;;
esac