mirror of
https://github.com/gryf/tabbedalt.git
synced 2026-03-27 13:53:34 +01:00
Compare commits
2 Commits
7e76d39402
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8da342b9b0 | |||
| a9eb5cee5d |
@@ -121,6 +121,10 @@ You can change those values but bear in mind, that first group should have
|
||||
timeout in seconds set higher, than middle one. You can also change symbols for
|
||||
those groups.
|
||||
|
||||
Tab activity can be disabled by setting::
|
||||
|
||||
URxvt.tabbedalt.disable-activity: true
|
||||
|
||||
Flickering
|
||||
~~~~~~~~~~
|
||||
|
||||
|
||||
40
tabbedalt
40
tabbedalt
@@ -150,11 +150,18 @@
|
||||
# - Add workaround for font flickering
|
||||
#
|
||||
# 2023-10-24 21:14:56
|
||||
# - Added confirmation when closing window when there is more than one tab or
|
||||
# - Added confirmation when closing window when there is more than one tab or
|
||||
# there is a process still running.
|
||||
#
|
||||
# 2023-10-28 16:30:32
|
||||
# - Added overlay based dialog to confirm closing urxvt window
|
||||
#
|
||||
# 2024-06-10 10:34:47
|
||||
# - Added option for disabling activity marks and colors
|
||||
#
|
||||
# 2024-12-10 18:30:22
|
||||
# - Fix an issue with requesting closing terminal, which appear to be a
|
||||
# single instance
|
||||
|
||||
use Scalar::Util;
|
||||
|
||||
@@ -228,6 +235,7 @@ package urxvt::ext::tabbedalt::main;
|
||||
sub tab_activity_mark ($$) {
|
||||
my ($self, $tab) = @_;
|
||||
return ' ' unless defined $tab->{lastActivity};
|
||||
return ' ' if $self->{disable_activity};
|
||||
return ' ' if $tab == $self->{cur};
|
||||
if (defined $self->{timeouts}) {
|
||||
my $diff = int urxvt::NOW - $tab->{lastActivity};
|
||||
@@ -306,12 +314,14 @@ sub refresh {
|
||||
if ($tab == $self->{cur}) {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab}) x $len;
|
||||
} else {
|
||||
if ($act eq "*") {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab_act}) x $len;
|
||||
} elsif ($act eq $self->{timeouts}[0][1]) {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab_acd}) x $len;
|
||||
} elsif ($act ne " ") {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab_acs}) x $len;
|
||||
if (!$self->{disable_activity}) {
|
||||
if ($act eq "*") {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab_act}) x $len;
|
||||
} elsif ($act eq $self->{timeouts}[0][1]) {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab_acd}) x $len;
|
||||
} elsif ($act ne " ") {
|
||||
@$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab_acs}) x $len;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,7 +366,7 @@ sub configure {
|
||||
# NOTE: switching between height +1 and height can be annoying,
|
||||
# especially well seen as flickering of part of the terminal on Intel
|
||||
# graphics and small fonts.
|
||||
|
||||
|
||||
# this is an extremely dirty way to force a configurenotify, but who
|
||||
# cares
|
||||
$tab->XMoveResizeWindow (
|
||||
@@ -566,6 +576,7 @@ sub init {
|
||||
$self->{stop_flickering} = $self->x_resource_boolean('stop-flickering');
|
||||
$self->{confirm_quit} = $self->x_resource_boolean('confirm-quit');
|
||||
$self->{confirm_program} = $self->x_resource('confirm-program');
|
||||
$self->{disable_activity} = $self->x_resource_boolean('disable-activity');
|
||||
|
||||
my $timeouts = $self->x_resource ("tabbar-timeouts");
|
||||
$timeouts = '16:.:8:::4:+' unless defined $timeouts;
|
||||
@@ -653,11 +664,12 @@ _on wm_delete_window => sub {
|
||||
my %process_to_skip = ( "bash"=>1, "zsh"=>1, "ps"=>1, "fish"=>1, "sh"=>1 );
|
||||
|
||||
foreach my $line (@subprocesses) {
|
||||
chomp $line;
|
||||
my @split_line = split(/ /, $line);
|
||||
$line =~ s/^\s+|\s+$//g;
|
||||
my @split_line = split(" ", $line);
|
||||
my $pid = @split_line[0];
|
||||
my $proc_name = @split_line[1];
|
||||
chomp $proc_name;
|
||||
my @line = split(" ", @split_line[1]);
|
||||
my $proc_name = @line[0];
|
||||
$proc_name =~ s/^\s+|\s+$//g;
|
||||
if (!exists $process_to_skip{$proc_name}) {
|
||||
$subp_count = $subp_count + 1;
|
||||
} else {
|
||||
@@ -691,10 +703,8 @@ _on wm_delete_window => sub {
|
||||
my $marginc = 0;
|
||||
$qst = "$qst (y/n)";
|
||||
if ((length $msg) > (length $qst)) {
|
||||
print("length $msg > length $qst\n");
|
||||
$marginc = int(($self->ncol - length $msg)/2);
|
||||
} elsif ((length $msg) <= (length $qst)) {
|
||||
print("length $msg <= length $qst\n");
|
||||
$marginc = int(($self->ncol - length $qst)/2);
|
||||
}
|
||||
my $marginr = int(($self->nrow - 4)/2);
|
||||
@@ -702,7 +712,7 @@ _on wm_delete_window => sub {
|
||||
|
||||
$tab->{overlay} = $tab->overlay_simple($marginc, $marginr,
|
||||
"$msg\n$qst");
|
||||
# action for removing all tabs will be decided in following
|
||||
# action for removing all tabs will be decided in following
|
||||
# method.
|
||||
$tab->enable(key_press => \&dialog_key_press);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user