summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2005-03-01 12:41:12 +0000
committerDaouda Lo <daouda@mandriva.com>2005-03-01 12:41:12 +0000
commit882223c3a6a276071b5ce727146716bf6075e649 (patch)
tree17fbffc6def99923f7b155f064bf29efb80412f5
parent3ff980e216f65b8111d6be355ccbd903aef8856d (diff)
downloaddrakx-882223c3a6a276071b5ce727146716bf6075e649.tar
drakx-882223c3a6a276071b5ce727146716bf6075e649.tar.gz
drakx-882223c3a6a276071b5ce727146716bf6075e649.tar.bz2
drakx-882223c3a6a276071b5ce727146716bf6075e649.tar.xz
drakx-882223c3a6a276071b5ce727146716bf6075e649.zip
- check and launch browser according to wm
-rw-r--r--perl-install/any.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index f96322387..eef475791 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -1006,6 +1006,23 @@ sub running_window_manager() {
undef;
}
+sub launch_browser_with_wm {
+ my ($link) = @_;
+ my $browser = $ENV{BROWSER} || $ENV{HELP_BROWSER} || find { -x "/usr/bin/$_" } qw(mozilla-firefox mozilla konqueror epiphany galeon);
+ my %h = (
+ 'kwin' => "webclient-kde",
+ 'gnome-session' => "webclient-gnome",
+ 'other' => $browser,
+ );
+ my $wm = any::running_window_manager();
+ $wm = 'other' if !member($wm, 'kwin', 'gnome-session');
+ my $cmd = $h{$wm} or return;
+ $cmd .= " $link";
+ log::l("Loading URL: $link");
+ system("$cmd &");
+ 1;
+}
+
sub ask_window_manager_to_logout {
my ($wm) = @_;