projects
/
hvlinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ffd05f
)
Lock xscreensaver before entering suspend
author
Hugo Villeneuve
<hugo@hugovil.com>
Fri, 9 Aug 2013 22:04:11 +0000
(18:04 -0400)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 10 Aug 2013 03:51:23 +0000
(23:51 -0400)
stage2/misc/acpi/suspend2ram.sh
patch
|
blob
|
history
diff --git
a/stage2/misc/acpi/suspend2ram.sh
b/stage2/misc/acpi/suspend2ram.sh
index
5283375
..
f3bfd6d
100755
(executable)
--- a/
stage2/misc/acpi/suspend2ram.sh
+++ b/
stage2/misc/acpi/suspend2ram.sh
@@
-22,6
+22,17
@@
esac
logger "Going to sleep"
logger "Going to sleep"
+XSCREENSAVER_ACTIVE="$(pidof /usr/bin/xscreensaver)"
+
+# Check if xscreensaver is running. if not, just skip on.
+if [ "x${XSCREENSAVER_ACTIVE}" != "x" ]; then
+ # Run the lock command as the user who owns xscreensaver process,
+ # and not as root, which won't work.
+ su "$(ps aux | grep xscreensaver | grep -v grep | grep ${XSCREENSAVER_ACTIVE} | awk '{print $1}' )" \
+ -c "/usr/bin/xscreensaver-command -lock" &
+ sleep 1
+fi
+
# discover video card's ID
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`
# discover video card's ID
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`