Use at your own risk.
---
 pm/module.d/Makefile.am |    3 ++-
 pm/module.d/uswsusp     |   28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/pm/module.d/Makefile.am b/pm/module.d/Makefile.am
index 6efd24d..0f8add5 100644
--- a/pm/module.d/Makefile.am
+++ b/pm/module.d/Makefile.am
@@ -2,7 +2,8 @@ moduledir = $(libdir)/pm-utils/module.d
 
 dist_module_SCRIPTS =  \
        kernel          \
-       tuxonice
+       tuxonice        \
+       uswsusp
 
 clean-local :
        rm -f *~
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
new file mode 100644
index 0000000..d2c50c4
--- /dev/null
+++ b/pm/module.d/uswsusp
@@ -0,0 +1,28 @@
+check_suspend() {
+       grep -q mem /sys/power/state && command_exists s2ram
+}
+
+do_suspend()
+{
+        s2ram -f
+}
+
+check_hibernate() {
+       [ -f /sys/power/disk ] && \
+       grep -q disk /sys/power/state && \
+       command_exists s2disk   
+}
+
+do_hibernate()
+{
+       s2disk
+}
+
+check_suspend_hybrid() {
+       grep -q mem /sys/power/state && command_exists s2both
+}
+
+do_suspend_hybrid()
+{
+        s2both -f
+}
-- 
1.5.3.8

_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to