summaryrefslogtreecommitdiffstats
path: root/draklive-install.wrapper
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2018-09-21 16:55:46 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2018-09-21 16:55:46 +0100
commit2d3fb600c299cc85b580a21aa095ac23b7cdcca4 (patch)
tree7be47e6f3eb74dea7e150d0e083d070758707dd1 /draklive-install.wrapper
parent70c038828228992b07a7c48da5ed1cdf85d917bf (diff)
downloaddraklive-install-2d3fb600c299cc85b580a21aa095ac23b7cdcca4.tar
draklive-install-2d3fb600c299cc85b580a21aa095ac23b7cdcca4.tar.gz
draklive-install-2d3fb600c299cc85b580a21aa095ac23b7cdcca4.tar.bz2
draklive-install-2d3fb600c299cc85b580a21aa095ac23b7cdcca4.tar.xz
draklive-install-2d3fb600c299cc85b580a21aa095ac23b7cdcca4.zip
Catch and ignore exception if there's no screensaver service.
This is needed if the installer is run from IceWM, which doesn't run xscreensaver or implement the freedesktop ScreenSaver API.
Diffstat (limited to 'draklive-install.wrapper')
-rwxr-xr-xdraklive-install.wrapper13
1 files changed, 8 insertions, 5 deletions
diff --git a/draklive-install.wrapper b/draklive-install.wrapper
index 1da9f0e..863ea3c 100755
--- a/draklive-install.wrapper
+++ b/draklive-install.wrapper
@@ -8,11 +8,14 @@ if ($>) {
# 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.
+ # If the ScreenSaver service isn't implemented, an exception will be thrown.
+ eval {
+ my $bus = Net::DBus->session;
+ my $service = $bus->get_service('org.freedesktop.ScreenSaver');
+ my $manager = $service->get_object('/ScreenSaver', 'org.freedesktop.ScreenSaver');
+ my $cookie = $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);