diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-09-21 16:55:46 +0100 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2018-09-21 16:55:46 +0100 |
commit | 2d3fb600c299cc85b580a21aa095ac23b7cdcca4 (patch) | |
tree | 7be47e6f3eb74dea7e150d0e083d070758707dd1 | |
parent | 70c038828228992b07a7c48da5ed1cdf85d917bf (diff) | |
download | draklive-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.
-rwxr-xr-x | draklive-install.wrapper | 13 |
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); |