reverseVideo from perl module
Jochen Keil
jochen.keil at gmail.com
Sun Aug 29 15:07:03 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello Marc,
On 29.08.2010 14:04, Marc Lehmann wrote:
> On Sun, Aug 29, 2010 at 10:23:03AM +0200, Jochen Keil
> <jochen.keil at gmail.com> wrote:
>> I am trying to set the rendition bit RS_RVid to make the colors of
>> a terminal permanently reversed. For now I've tried using this:
>
> Are you sure this is really what you want to do? Could you describe
> what you are *really* trying to do, maybe there is a better solution
> for your problem? Or a solution at all, as what you are trying to do
> cannot be done.
What i like to do is this: invert (or swap fore/background) colours so
that my terminal appears brighter (i have a dark background by default)
when i'm in a bright environment.
>> $term->scr_xor_span(0, 0, $term->nrow-1, $term->ncol-1,
>> urxvt::RS_RVid);
>>
>> Unfortunately this doesn't last. On the next refresh (as soon as I
>> type something in the terminal) it will switch back to "normal"
>> colors.
>
> 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. :)
>> So how could make video permanently reversed like after starting
>> urxvt with the reverseVideo resource set?
>
> 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:
my $rend = urxvt::DEFAULT_RSTYLE;
my $foreground = urxvt::GET_BASEFG($rend);
my $background = urxvt::GET_BASEBG($rend);
$rend = urxvt::SET_FGCOLOR($rend, $background);
$rend = urxvt::SET_BGCOLOR($rend, $foreground);
$term->rstyle($rend);
Now the text i'm typing appears inverted but not the rest of the
terminal.. not exactly what i wanted.
> Same is true for scr_rvideo_mode, it will interfere with the visual
> bell.
>
> Same is true for inverting them in a display filter.
>
> All these will change the appearance to be reversed, but will not
> actually reverse the attributes.
I have attached a preliminary version of the plugin i'm trying to write.
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.
Best Regards,
Jochen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAkx6W3cACgkQtVwvsA+W4CBIYwCcDWzj6s73A4DbLh8vNeD3l4P7
3xkAnjtPTwHeF7Z/hLiOU6Zt0gh6o7iJ
=FY6R
-----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/20100829/19dd3e1e/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/20100829/19dd3e1e/attachment.sig>
More information about the rxvt-unicode
mailing list