Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[adv_windowlist] Make the statusbar leader text configurable #343

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions scripts/adv_windowlist.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use strict;
use warnings;

our $VERSION = '1.3'; # 463402cffae35e5
our $VERSION = '1.3.1'; # 463402cffae35e5
our %IRSSI = (
authors => 'Nei',
contact => 'Nei @ anti@conference.jabber.teamidiot.de',
Expand Down Expand Up @@ -82,6 +82,9 @@
# /format awl_viewer_item_bg <string>
# * string : Format String specifying the viewer's item background colour
#
# /set awl_sb_leader <string>
# * string : String to put before the awl statusbar item (default: "Awl: ")
#
# /set awl_prefer_name <ON|OFF>
# * this setting decides whether awl will use the active_name (OFF) or the
# window name as the name/caption in awl_display_*.
Expand Down Expand Up @@ -390,6 +393,7 @@ sub syncLines {
@actString;
$currentLines = 1 if !$currentLines && $S{shared_sbar};
if ($S{shared_sbar} && !$statusbars{shared}) {
my $sb_leader = Irssi::settings_get_str('awl_sb_leader');
my $l = set 'shared';
{
no strict 'refs';
Expand All @@ -398,7 +402,7 @@ sub syncLines {
my ($item, $get_size_only) = @_;

my $text = $actString[0];
my $pat = defined $text ? '{sb '.ucfirst(setc()).': $*}' : '{sb }';
my $pat = defined $text ? '{sb '.$sb_leader.'$*}' : '{sb }';
$text //= '';
$item->default_handler($get_size_only, $pat, $text, 0);
};
Expand Down Expand Up @@ -1635,6 +1639,7 @@ sub runsub {
Irssi::settings_add_str( setc, set 'viewer_tmux_position', 'left'); #
Irssi::settings_add_str( setc, set 'viewer_xwin_command', 'xterm +sb -e %A'); #
Irssi::settings_add_str( setc, set 'viewer_custom_command', ''); #
Irssi::settings_add_str( setc, set 'sb_leader', ucfirst(setc()).': '); #

Irssi::signal_add_last({
'setup changed' => 'setup_changed',
Expand Down Expand Up @@ -2393,6 +2398,7 @@ UNITCHECK

# Changelog
# =========
# 1.3.1 - made the status bar leader configurable (default remains "Awl: ")
# 1.3 - workaround for irssi issue #572
# 1.2 - new format to choose abbreviation character
# 1.1 - infinite loop on shortening certain window names reported by Kalan
Expand Down