summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/usr/local/lib/tails-i2p-removal-notify-user
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-includes/usr/local/lib/tails-i2p-removal-notify-user')
-rwxr-xr-xconfig/chroot_local-includes/usr/local/lib/tails-i2p-removal-notify-user63
1 files changed, 63 insertions, 0 deletions
diff --git a/config/chroot_local-includes/usr/local/lib/tails-i2p-removal-notify-user b/config/chroot_local-includes/usr/local/lib/tails-i2p-removal-notify-user
new file mode 100755
index 0000000..25408c4
--- /dev/null
+++ b/config/chroot_local-includes/usr/local/lib/tails-i2p-removal-notify-user
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+#man{{{
+
+=head1 NAME
+
+tails-i2p-removal-notify-user
+
+=head1 VERSION
+
+Version X.XX
+
+=head1 AUTHOR
+
+Tails dev team <amnesia@boum.org>
+See https://tails.boum.org/.
+
+=cut
+
+#}}}
+
+use Desktop::Notify;
+use English '-no_match_vars';
+use Locale::gettext;
+use Net::DBus::Reactor;
+use POSIX;
+
+### initialization
+setlocale(LC_MESSAGES, "");
+textdomain("tails");
+
+### callbacks
+
+sub action_cb {
+ my $reactor = shift;
+ unless (fork) {
+ exec(
+ '/usr/local/bin/tails-documentation',
+ 'doc/anonymous_internet/i2p',
+ 'removal',
+ );
+ }
+ $reactor->shutdown;
+}
+
+### main
+
+my $reactor = Net::DBus::Reactor->main;
+
+my $notify = Desktop::Notify->new();
+$notify->action_callback(sub { action_cb($reactor, @_) });
+$notify->close_callback(sub { $reactor->shutdown; });
+
+my $summary = gettext("Warning: I2P will be removed in Tails 2.12");
+$notify->create(summary => $summary,
+ actions => { "moreinfo_$PID" => gettext('Learn more'), },
+ hints => { 'transient' => 1, },
+ timeout => 0)->show();
+
+$reactor->run;