Repository navigation
Expand file tree
/
Copy pathsb_separator.pl
More file actions
64 lines (49 loc) · 1.84 KB
/
Copy pathsb_separator.pl
File metadata and controls
64 lines (49 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# $Id: sb_separator.pl,v 0.1 2025/10/14 21:40 Hravnkel $
#
# Run command '/statusbar additem -after user -alignment left -priority 1 separator' after loading sb_separator.pl.
#
use strict;
use warnings;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.1';
%IRSSI = (
authors => 'Björn Sundberg',
contact => 'bjorn@forndata.org',
name => 'sb_separator',
description => 'Displays up to three user defined separators in statusbar',
modules => '',
sbitems => 'separator separator_2 separator_3',
license => 'GNU GPL v2',
url => 'https://github.com/Hravnkel/irssi-sb_separator',
changed => 'Sun Dec 21 20:24:45 CET 2025'
);
use Irssi::TextUI;
my ($separator, $separator_2, $separator_3);
sub separator {
my ($item, $get_size_only) = @_;
my $theme = Irssi::current_theme();
my $separator = $theme->format_expand("{sb_separator}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $format = sprintf('{sb %s}', $separator);
$item->default_handler($get_size_only, $format, undef, 1);
}
sub separator_2 {
my ($item, $get_size_only) = @_;
my $theme = Irssi::current_theme();
my $separator_2 = $theme->format_expand("{sb_separator_2}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $format = sprintf('{sb %s}', $separator_2);
$item->default_handler($get_size_only, $format, undef, 1);
}
sub separator_3 {
my ($item, $get_size_only) = @_;
my $theme = Irssi::current_theme();
my $separator_3 = $theme->format_expand("{sb_separator_3}",
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
my $format = sprintf('{sb %s}', $separator_3);
$item->default_handler($get_size_only, $format, undef, 1);
}
Irssi::statusbar_item_register('separator', '', 'separator');
Irssi::statusbar_item_register('separator_2', '', 'separator_2');
Irssi::statusbar_item_register('separator_3', '', 'separator_3');