summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-01-16 14:08:04 +0000
committerDaouda Lo <daouda@mandriva.com>2003-01-16 14:08:04 +0000
commite91699b32391e3942b3c95e6e495f4c60cde0c2c (patch)
tree3f522113c18be608d5d10ee2d2014214aeb5bdd4 /perl-install/standalone
parent2ff8d37f7c51c03e37638c37e030e060d2c34669 (diff)
downloaddrakx-e91699b32391e3942b3c95e6e495f4c60cde0c2c.tar
drakx-e91699b32391e3942b3c95e6e495f4c60cde0c2c.tar.gz
drakx-e91699b32391e3942b3c95e6e495f4c60cde0c2c.tar.bz2
drakx-e91699b32391e3942b3c95e6e495f4c60cde0c2c.tar.xz
drakx-e91699b32391e3942b3c95e6e495f4c60cde0c2c.zip
- syntax : drakhelp relative_link
example: drakhelp Quick_Startup.html/drakx.html - drakhelp will check the running wm and will launch kdehelpcenter with the correct URL after localizing the link. Otherwise, it launch a default browser: mozilla konqueror or galeon.
Diffstat (limited to 'perl-install/standalone')
-rw-r--r--perl-install/standalone/drakhelp28
1 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/standalone/drakhelp b/perl-install/standalone/drakhelp
new file mode 100644
index 000000000..265ecc83e
--- /dev/null
+++ b/perl-install/standalone/drakhelp
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+
+use standalone; #- warning, standalone must be loaded very first, for 'explanations'
+
+use interactive;
+use common;
+use lang;
+use any;
+
+my $lang = lang::lang2LANG(lang::read('',$>)) || 'en';
+if (!member($lang, qw(de en es fr it ru))) { $lang = 'en' };
+my $path_to_help = "/usr/share/doc/mandrake/" . $lang . "/";
+
+if ((my $wm = any::running_window_manager()) eq 'kwin') {
+ system("mdklaunchhelp " . $path_to_help . $ARGV[0] . "&");
+} else {
+ on_request_help($path_to_help . $ARGV[0])
+}
+
+sub on_request_help {
+ my ($link) = @_;
+ my $browser = $ENV{BROWSER} || find { -x "/usr/bin/$_" } qw(mozilla konqueror galeon) or return;
+ standalone::explanations("Connection to help system at $link");
+ system("$browser $link &");
+}
+