reverseVideo from perl module

Jochen Keil jochen.keil at gmail.com
Tue Aug 31 16:39:05 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On 29.08.2010 17:22, Marc Lehmann wrote:
> On Sun, Aug 29, 2010 at 03:07:03PM +0200, Jochen Keil
> <jochen.keil at gmail.com> wrote:
>>> You have to set reverse video mode (e.g. by outputting the
>>> relevant command sequence or manipulating the rendset).
>> How would i do that? Sorry for being ignorant, but i thought
>> scr_xor_span would do just that. :)
>
> See urxvt(7) for all command sequences.
thanks for the hint.
Cmd_parse("\033[?5h") respectively cmd_parse("\033[?5l") do the trick
for me. However i'm having a problem with $self->refresh(). It doesn't
happen instantly. The terminal only gets refreshed if I hit a key (it is
not necessary that the terminal is focused though).
I also tried cmd_parse("\033[7;7t") but I'm not sure about that.
Maybe you could give me a short explanation on how to understand this:
"ESC [ Ps;Pt t"
           Window Operations
           Ps = 7      Refresh screen once

>>> Just swap foreground and background colours, thats how uxvt does
>>> it - no rvid at all, which is not what you seem to want though.
>> OK, so i tried this:
>
> No, I mean, swap the colours, not the indices. You can do this easily
> from a shellscript by using the OSC 10/11 sequences for example (look
> for "XTerm Operating System Commands").
>
>> It's basically a listener on dbus for the 'BrightnessChanged'
>> signal and then unlocks a barrier. It's not yet done, just for you
>> to get an idea what i'm trying to do.
>
> Yes, this makes it very clear.
>
> Hint: if you want to make the plug-in portable, don't use the windows
> process emulation code (so called "threads" in perl, even though they
> have nothing to do with threads) - it makes no sense to use it under
> unix, and is often disabled because of the very large overhead it
> causes.
I'm using this perl version:
$ perl --version

This is perl 5, version 12, subversion 1 (v5.12.1) built for
i686-linux-thread-multi

The plugin works so far (for me), but I don't know how it would behave
without threads. Writing it without threads would be tedious though
since I'd have to use pipes (would a pipe in /tmp be portable anyway?).
Any suggestions on how to do it better are welcome. I'm not a perl
hacker (honestly these are my first steps with perl..) but I have enough
experience with other languages (e.g. tcl which is quite comparable).

> And last not least, keep in mind that urxvt does not support the
> windows process emulation code, so you have to fix the race
> conditions that ensue somehow (e.g. by not calling urxvt functions
> from any other "thread" than the urxvt one).
My plugin now isn't dependant on locks anymore.. yet there is still the
problem with refreshing. I could set a 1s timer but I'm not to fond of
polling.

I've attached the improved version of the plugin for you. I'm using
async now because the block is turned into a closure (at least the doc
says so :) ).

Kind regards,

Jochen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkx9FAkACgkQtVwvsA+W4CA8dgCfRFW6jxNKM3yXD1SvDbvbvb6N
+8sAn2CxrVJ6DF+ilvxl9rD6DOrM6/7e
=1yVF
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rvid-on-brightnesschanged
URL: <http://lists.schmorp.de/pipermail/rxvt-unicode/attachments/20100831/a33491f8/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rvid-on-brightnesschanged.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/rxvt-unicode/attachments/20100831/a33491f8/attachment.sig>


More information about the rxvt-unicode mailing list