summaryrefslogtreecommitdiffstats
path: root/files/draklive-install
diff options
context:
space:
mode:
Diffstat (limited to 'files/draklive-install')
-rw-r--r--files/draklive-install20
1 files changed, 20 insertions, 0 deletions
diff --git a/files/draklive-install b/files/draklive-install
new file mode 100644
index 0000000..018afd4
--- /dev/null
+++ b/files/draklive-install
@@ -0,0 +1,20 @@
+#!/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");