diff options
-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); |