1
0
mirror of https://github.com/gryf/tabbedalt.git synced 2025-12-17 11:30:31 +01:00

restored tab_property_notify hook

This commit is contained in:
2013-11-12 09:47:40 +01:00
parent 28d687cb5a
commit fe408c9cd6
2 changed files with 31 additions and 19 deletions

View File

@@ -2,8 +2,8 @@
Tabbed
======
This is modified tabbed extension for well known `urxvt-unicode
<http://software.schmorp.de/pkg/rxvt-unicode.html>`_ terminal emulator
This is modified tabbed extension for well known `urxvt-unicode`_ terminal
emulator
Features
--------
@@ -13,7 +13,7 @@ Features
under CTRL+SHIFT+N shortcut. After creating first custom shell this default
will be discarded.
.. image:: https://raw.github.com/gryf/tabbed/master/screens/tabbed.png
.. image:: screens/tabbed.png
:alt: Named tabs
* Shortcuts can be attached to Super_L and Super_R keys together with others
@@ -21,17 +21,14 @@ Features
where *num* can be 0 to 9. CTRL+0 will switch to tenth tab.
* Numbers in tabs can be switched off in by setting
resource:``URxvt.tabbed.tab-numbers: false``
* Integrated `activity indicator
<http://mina86.com/2009/05/16/tabbed-urxvt-extension/>`_ with additional
features like colors and different characters instead of simply asterisk
depending on time.
* Integrated `activity indicator`_ with additional features like colors and
different characters instead of simply asterisk depending on time.
.. image:: https://raw.github.com/gryf/tabbed/master/screens/tabbed.gif
.. image:: screens/tabbed.gif
:alt: Indicator activity
* Integrated tab renaming from `stepb
<http://github.com/stepb/urxvt-tabbedex>`_. Default under SHIFT+UP, then type
some text and RETURN for accept, ESC for cancel.
* Integrated tab renaming from `stepb`_. Default under SHIFT+UP, then type some
text and RETURN for accept, ESC for cancel.
Installation
------------
@@ -106,3 +103,7 @@ After that invoke urxvt with perl extensions enabled::
$ urxvt -pe tabbed
That's all.
.. _urxvt-unicode: http://software.schmorp.de/pkg/rxvt-unicode.html
.. _activity indicator: http://mina86.com/2009/05/16/tabbed-urxvt-extension/
.. _stepb: http://github.com/stepb/urxvt-tabbedex

17
tabbed
View File

@@ -96,6 +96,10 @@
# session, which should contain pipe separated shortcuts defined in tabcmds
# resource. If there is no shortcuts (or wrong was defined), plain shell tab
# will appear.
#
# 2013-11-12 09:23:49
# - Restored tab_property_notify hook. Whatever was the cause of the memory
# consumption is gone or doesn't have anything to do with that function.
sub tab_activity_mark ($$) {
@@ -439,7 +443,7 @@ sub on_start {
# Ugly as hell ``session'' implementation
my $count = 0;
if (qx(ps x|grep urxvt|grep -v grep|wc -l) < 2 && scalar(@{$self->{session}})){
if (qx(ps x|grep " urxvt "|grep -v grep|wc -l) < 2 && scalar(@{$self->{session}})){
for my $item (@{$self->{session}}){
if (exists($self->{tabcmds}{uc($item)})){
$self->new_tab(@{$self->{tabcmds}{uc($item)}});
@@ -624,6 +628,14 @@ sub tab_add_lines {
();
}
sub tab_property_notify {
my ($self, $tab, $event) = @_;
$self->copy_properties
if $event->{window} == $tab->parent;
()
}
package urxvt::ext::tabbed::tab;
@@ -631,7 +643,7 @@ package urxvt::ext::tabbed::tab;
# simply proxies all interesting calls back to the tabbed class.
{
for my $hook qw(start destroy key_press add_lines) {
for my $hook qw(start destroy key_press add_lines property_notify) {
eval qq{
sub on_$hook {
my \$parent = \$_[0]{term}{parent}
@@ -642,4 +654,3 @@ package urxvt::ext::tabbed::tab;
die if $@;
}
}