diff options
-rw-r--r-- | dotfiles/Xresources | 2 | ||||
-rw-r--r-- | install.conf.yaml | 2 | ||||
-rwxr-xr-x | urxvt/reverse | 22 |
3 files changed, 26 insertions, 0 deletions
diff --git a/dotfiles/Xresources b/dotfiles/Xresources index 874d827..e832883 100644 --- a/dotfiles/Xresources +++ b/dotfiles/Xresources @@ -34,6 +34,8 @@ URxvt.scrollTTYKeyPress: true URxvt.inputMethod: ibus URxvt.preeditType: OverTheSpot +URxvt.keysym.M-r: reverse:toggle + URxvt.keysym.M-u: reselect:url URxvt.keysym.M-g: reselect:git_hash URxvt.keysym.M-i: reselect:message_id diff --git a/install.conf.yaml b/install.conf.yaml index 5298f4b..c3808eb 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -9,6 +9,7 @@ - ~/.local/var/dotfiles - ~/.local/var/less - ~/.local/var/vim/undo + - ~/.urxvt/ext - ~/.vim/colors - ~/.vim/ftplugin/rst - ~/.vim/pack/dotfiles/start @@ -30,6 +31,7 @@ ~/.local/var/cron/daily/dotfiles_status: cron/dotfiles_status ~/.profile: dotfiles/profile ~/.tmux.conf: dotfiles/tmux.conf + ~/.urxvt/ext/reverse: urxvt/reverse # TODO: clean up and install linediff script ~/.vimrc: vim/vimrc ~/.vim/colors/inkpot.vim: vim/inkpot.vim diff --git a/urxvt/reverse b/urxvt/reverse new file mode 100755 index 0000000..8e99201 --- /dev/null +++ b/urxvt/reverse @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +# Implement a 'toggle' command that toggles reverse video on and off + +sub on_action +{ + my ($self, $cmd) = @_; + + if ($cmd eq "toggle") { + my $e = $self->{enabled}; + my $act = $e ? "l" : "h"; + $self->{enabled} = not $e; + $self->cmd_parse("\033[?5" . $act) + } +} + +sub on_start +{ + my ($self) = @_; + + $self->{enabled} = 0; +} |