summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-08-07 23:59:33 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-08-07 23:59:33 +0100
commit70c038828228992b07a7c48da5ed1cdf85d917bf (patch)
tree2855d5728e5fa78dd897cb814f7e09da386ddd91
parentaf1d4d8b55b4e9bafe344ecc0b1e5da138c4dfc7 (diff)
downloaddraklive-install-70c038828228992b07a7c48da5ed1cdf85d917bf.tar
draklive-install-70c038828228992b07a7c48da5ed1cdf85d917bf.tar.gz
draklive-install-70c038828228992b07a7c48da5ed1cdf85d917bf.tar.bz2
draklive-install-70c038828228992b07a7c48da5ed1cdf85d917bf.tar.xz
draklive-install-70c038828228992b07a7c48da5ed1cdf85d917bf.zip
Disable screensaver/lock whilst installer is running.
(as requested by the QA team)
-rw-r--r--NEWS2
-rwxr-xr-xdraklive-install.wrapper26
2 files changed, 22 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index 85c85ca..5a348c9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- disable screensaver/lock whilst installer is running
+
2.15
- revised template for matching live media disk labels
- translation updates
diff --git a/draklive-install.wrapper b/draklive-install.wrapper
index 5a8f4eb..1da9f0e 100755
--- a/draklive-install.wrapper
+++ b/draklive-install.wrapper
@@ -1,6 +1,20 @@
-#!/bin/sh
-if [[ "$UID" != "0" ]] ; then
- /usr/bin/pkexec /usr/sbin/draklive-install-lock-storage "$@"
- exit $?
-fi
-exec /usr/sbin/draklive-install-lock-storage "$@"
+#!/bin/perl
+use Net::DBus;
+
+if ($>) {
+ if (system('ps -C xscreensaver') == 0) {
+ # xscreensaver doesn't implement the freedesktop API, so we just have to kill it,
+ # We expect the user to reboot after the install completes, so don't bother to
+ # reenable it.
+ system('xscreensaver-command -exit');
+ } else {
+ my $bus = Net::DBus->session;
+ my $service = $bus && $bus->get_service('org.freedesktop.ScreenSaver');
+ my $manager = $service && $service->get_object('/ScreenSaver', 'org.freedesktop.ScreenSaver');
+ my $cookie = $manager && $manager->Inhibit('draklive-install', 'Install in progress');
+ # The screensaver will be automatically uninhibited when this process exits.
+ }
+ my $status = system("/usr/bin/pkexec /usr/sbin/draklive-install-lock-storage @ARGV");
+ exit($status);
+}
+exec("/usr/sbin/draklive-install-lock-storage @ARGV");