rxvt-unicode with 256 colors in Fedora/RHEL/CentOSNOTE: Since rxvt-unicode 9.09 (November 2010) support for 256 colors is officially included, which means that in newer releases (e.g., Fedora 14) you can skip all the stuff below and just install rxvt-unicode-256color or rxvt-unicode-256color-ml. OLD INSTRUCTIONS: My favorite terminal, rxvt-unicode (urxvt), has 88 color support by default. However, my favorite vim color scheme, Zenburn, needs more than that. While I found a good post about doing it in Ubuntu I couldn't find anything about doing it in Fedora/RHEL/CentOS; so here goes. I did this on a machine running Fedora 13. The rxvt-unicode source actually includes an unsupported patch for 256 colors, so we need to get the source rpm, modify the source and rebuild. Patch and rebuild urxvtIf you don't have yum-builddep and yumdownloader, run yum install yum-utils. Install necessary build dependencies: # yum-builddep rxvt-unicode Get the source: $ yumdownloader --source rxvt-unicode (You will also need the usual development stuff if you don't already have them, e.g., yum install gcc make kernel-devel rpm-build and possibly others.) Install the source rpm: $ rpm -i rxvt-unicode-9.07-1.fc13.src.rpm This will install the source RPM to your user's ~/rpmbuild directory. Extract the source and make a copy of it: $ cd ~/rpmbuild/SOURCES $ tar xvfj rxvt-unicode-9.07.tar.bz2 $ cp -r rxvt-unicode-9.07 rxvt-unicode-9.07a Patch the copy with the 256 color patch: $ cd rxvt-unicode-9.07a/ $ patch -p1 < doc/urxvt-8.2-256color.patch Create a patch file for the RPM build: $ cd .. $ diff -uNr rxvt-unicode-9.07 rxvt-unicode-9.07a > rxvt-unicode-9.07-256colors.patch Now we have to edit the spec file so that the patch is included in the build: $ vi ../SPECS/rxvt-unicode.spec Add Patch0: rxvt-unicode-9.07-256colors.patch to the top section of the file, e.g.: Source1: rxvt-unicode.desktop
Patch0: rxvt-unicode-9.07-256colors.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Also add %patch0 -p1 on a line before %build further down, e.g.: %setup -q %patch0 -p1 %build Also change Release in the top of the file (probably line 3) to something higher, otherwise rpm will think that the already installed version of rxvt-unicode is newer. E.g., from 1%{?dist} to 2%{?dist}. Use rpmbuild to patch, configure, compile and build a binary RPM: $ cd .. $ rpmbuild -ba SPECS/rxvt-unicode.spec You will find the RPM in the subdirectory RPMS/arch, e.g., RPMS/x86_64/rxvt-unicode-9.07-1.fc13.x86_64.rpm. Install it as root: # rpm -Uvh RPMS/x86_64/rxvt-unicode-9.07-2.fc13.x86_64.rpm Fix terminfoNow we just need to make terminfo aware of rxvt-unicode's new capabilities. Thanks again Garry: (execute the following as your normal user) $ cd ~ $ infocmp -L rxvt-unicode > rxvt-unicode.terminfo $ vi rxvt-unicode.terminfo Change (on line 8 in my file) lines_of_memory#0, max_colors#88, max_pairs#256, to lines_of_memory#0, max_colors#256, max_pairs#32767, Final steps: $ install -d .terminfo $ tic -o .terminfo/ rxvt-unicode.terminfo Start a new urxvt and try running the script 256colors2.pl. It's included in the xterm source, but you can also download it from here. $ perl 256colors2.pl It should look like this: Protect urxvt from being updatedIf you don't want yum to replace your patched urxvt when a newer version is available, edit /etc/yum.conf and add the following line to section [main]: exclude=rxvt-unicode 2010-10-25 · rxvt-unicode · urxvt
blog comments powered by Disqus
|
|