summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorailin-nemui2016-07-01 14:47:50 +0200
committerGitHub2016-07-01 14:47:50 +0200
commit431a41d9d6c054be5384ad08047b972b7b4c6d5f (patch)
treec3b302c06dbee7ab06126a6ecea45b460ad4f2da
parent39567cf3cdb2f078afa0d585145eaa65aa60ce40 (diff)
parent49d7471062645924376ed46db8b3f2898710567a (diff)
downloadscripts.irssi.org-431a41d9d6c054be5384ad08047b972b7b4c6d5f.tar.bz2
Merge pull request #289 from tslocum/urlgrab-287
Allow /url's browser command to be configured. Closes #286, closes #287.
-rw-r--r--scripts/urlgrab.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/urlgrab.pl b/scripts/urlgrab.pl
index 00b0c64..d322e0e 100644
--- a/scripts/urlgrab.pl
+++ b/scripts/urlgrab.pl
@@ -1,13 +1,20 @@
#!/usr/bin/perl -w
+#
+# Settings:
+# /SET urlgrab_command <command>
+# Command to execute when opening URLs
+# Default: xdg-open '%s' > /dev/null 2>&1
+#
+
use strict;
use Irssi 20010120.0250 ();
use vars qw($VERSION %IRSSI);
-$VERSION = "0.2";
+$VERSION = "0.3";
%IRSSI = (
authors => 'David Leadbeater',
contact => 'dgl@dgl.cx',
name => 'urlgrab',
- description => 'Captures urls said in channel and private messages and saves them to a file, also adds a /url command which loads the last said url into mozilla.',
+ description => 'Captures urls said in channel and private messages and saves them to a file, also adds a /url command which loads the last said url into a browser.',
license => 'GNU GPLv2 or later',
url => 'http://irssi.dgl.cx/',
);
@@ -34,7 +41,7 @@ sub url_cmd{
Irssi::print("No url captured yet");
return;
}
- system("netscape-remote -remote 'openURL($lasturl)' &>/dev/null");
+ system(sprintf(Irssi::settings_get_str("urlgrab_command"), $lasturl));
}
sub find_url {
@@ -56,7 +63,7 @@ sub url_log{
close(URLLOG);
}
+Irssi::settings_add_str("misc", "urlgrab_command", "xdg-open '%s' > /dev/null 2>&1");
Irssi::signal_add_last("message public", "url_public");
Irssi::signal_add_last("message private", "url_private");
Irssi::command_bind("url", "url_cmd");
-