Skip to content

Instantly share code, notes, and snippets.

@ignisf
Last active December 17, 2015 09:09
Show Gist options
  • Save ignisf/5585275 to your computer and use it in GitHub Desktop.
Save ignisf/5585275 to your computer and use it in GitHub Desktop.
add a marker line on away
--- a/trackbar.pl 2008-05-17 18:39:11.000000000 +0300
+++ b/trackbar.pl 2013-02-14 18:45:35.000000000 +0200
@@ -128,6 +128,20 @@
}
);
+Irssi::signal_add(
+ 'away mode changed' => sub {
+ my $oldwindow = Irssi::active_win();
+
+ if ($oldwindow) {
+ my $line = $oldwindow->view()->get_bookmark('trackbar');
+ $oldwindow->view()->remove_line($line) if defined $line;
+ $oldwindow->print(line($oldwindow->{'width'}), MSGLEVEL_NEVER);
+ $oldwindow->view()->set_bookmark_bottom('trackbar');
+ Irssi::command("redraw");
+ }
+ }
+);
+
sub line {
my $width = shift;
my $string = $config{'trackbar_string'};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment