Mounir Lamouri's Blog

To content | To menu | To search

Tag - {{tpl:TagID}}

Entries feed - Comments feed

256 colors terminal with tmux and urxvt

A few days ago, I was trying to change my vim theme for a 256-color one and I realized urxvt was not supporting 256 colors out of the box. Hopefully, there is a patch to get a 256 colors terminal with urxvt. It is available in the the Gentoo package, you just have to enable the xterm-color USE flag for rxvt-unicode like this:

echo "x11-terms/rxvt-unicode xterm-color >> /etc/portage/package.use

If you recompile rxvt-unicode, you should now get more colors. You can test it by using a 256-color vim theme like desert256 [1]. You can also run:

tput colors

I got 88 instead of 256. I don't know why but it's still a lot better than 16 colors.

Now, you have to make sure tmux is using 256 colors otherwise you will get a weird behavior. According to the tmux FAQ, it is really easy and you have to add a this line in ~/.tmux.conf:

set -g default-terminal "screen-256color"

In my system it was not working so I have to tell tmux my terminal supports 256 colors by using '-2' argument. You can add this line to your ~/.bashrc to always call tmux with '-2':

 alias tmux="tmux -2"

Now, if you run `tput colors` in a tmux session, you should get 256.

If you are using vim, you should add this line to you ~/.vimrc:

set t_Co=256

Hope this is helping !

Notes

[1] To compare themes, you can try http://code.google.com/p/vimcolorsc...

Why some Firefox plugins need to be compiled, example with Weave

Gentoo let the user installing a few Firefox and Thunderbird plugins via the package manager and people often consider it is useless. Actually, there are at least two reasons why it can be useful.
The first one is obvious : when installing a plugin with the package manager, you are sure it will be available for every users (except if it is manually disabled by the user). For example, you can install noscript for security reasons directly by enabling restrict-javascript USE flag.
The other reason is the compilation. Indeed, most plugins are platform-independent but some of them are not and those ones are not guarantee to work on your computer. For example, you can install Firefox on a lot of different platforms. If you stay with GNU/Linux, you can install Firefox 3.5 on alpha, amd64 (x86-64), arm, hppa, ia64, ppc, ppc64, x86[1] . This is true at least with Gentoo. It goes without saying if a plugin has a platform-dependent part, it will not provide a binary for all these platforms.

Concretely, I tried to install Weave 1.0 beta 1 and 2 from addons.mozilla.org. When launching Firefox, I got this output in the Weave Activity Log view:

2009-11-25 12:34:02	Service.Main         INFO	Loading Weave 1.0b2 in 5 sec.
2009-11-25 12:34:08	Engine.Bookmarks     DEBUG	Engine initialized
2009-11-25 12:34:09	Engine.Forms         DEBUG	Engine initialized
2009-11-25 12:34:10	Engine.History       DEBUG	Engine initialized
2009-11-25 12:34:10	Engine.Passwords     DEBUG	Engine initialized
2009-11-25 12:34:10	Engine.Prefs         DEBUG	Engine initialized
2009-11-25 12:34:10	TabTracker           DEBUG	Failed to load json: this.changedIDs is undefined JS Stack trace: ([object Object])@trackers.js:125 < Utils_jsonLoad("weave/changes/tab_tracker.json",[object Object],(function (json) {for (let id in json) {this.changedIDs[id] = 1;}}))@util.js:559 < T_loadChangedIDs()@trackers.js:123 < T__init()@trackers.js:76 < TabTracker__init()@tabs.js:356 < TabTracker()@tabs.js:345 < ()@engines.js:161 < Engine__init()@engines.js:179 < _init()@engines.js:303 < TabEngine()@tabs.js:56 < EngMgr_register(TabEngine,5,[object Array])@engines.js:113 < EngMgr_register([object Array])@engines.js:106 < WeaveSvc__registerEngines()@service.js:379 < _onStartup([object Object])@service.js:278 < notify([object XPCWrappedNative_NoHelper])@util.js:624
2009-11-25 12:34:11	Engine.Tabs          DEBUG	Engine initialized
2009-11-25 12:34:11	Service.Main         INFO	Resetting client syncID from _onStartup.
2009-11-25 12:34:11	Service.Main         INFO	Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.9.1.4) Gecko/20091109 Gentoo Firefox/3.5.4
2009-11-25 12:34:11	Service.Util         WARN	Component @labs.mozilla.com/Weave/Crypto;1 requested, but doesn't exist on this platform.
2009-11-25 12:34:11	Service.Main         DEBUG	Crypto check failed: TypeError: Svc.Crypto is null
2009-11-25 12:34:11	Service.Main         ERROR	Could not load the Weave crypto component. Disabling Weave, since it will not work correctly.
2009-11-25 12:34:11	Service.Main         INFO	Weave Sync disabled

If you unzip the xpi file, you will found a platform/ directory which is containing platform-dependent files. If we stay with GNU/Linux, we have Linux/, Linux_x86_64-gcc3/ and Linux_x86-gcc3/ directories. If we launch 'file platform/Linux/components/WeaveCrypto.so', we got:

platform/Linux/components/WeaveCrypto.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped

So, x86, x86-64 and arm are supported, not surprising. But my old Powerbook G4 (PowerPC) is not. Actually, it would be if I was using MacOS X instead of GNU/Linux.

I don't know if addons.mozilla.org should specify the supported platforms for platform-dependent plugins because arm, x86 and x86-64 are covering most of the target systems. Actually, as far as I know PowerPC is fully supported only by Gentoo and Debian. Anyway, if you are using an unconventional platform, you may want to compile your own weave plugin and probably a few others.

Luckily, weave has just been updated to 1.0b2 in the Gentoo tree :)

Notes

[1] mips is working with Firefox 2.0.0.19 and sparc with Firefox 3.0.11

Introducing media-video/miro

Miro described itself as Open-source, non-profit video player and podcast client. It's actually somewhat a swiss-knife for videos if you are using video sharing services (like youtube or dailymotion), following podcasts and downloading videos via bittorrent.
Miro lets you do everything in one place. You can directly search for a video, download it and see it locally. Then you can organize your videos whatever it comes from and remove them when you want. To me, it's sound like the equivalent of songbird for videos.

Miro is also known for it's "Adopt a line" campaign which consist of paying 4$ per month to adopt a line of code and support the project. An innovative idea which seems to work.

So, bug 131527 is now fixed and Miro is known as media-video/miro in Gentoo's tree.
Try it and report bugs !

Gentoo/PPC needs you !

Gentoo/PPC team is here to make sure packages are marked stable and are keyworded as soon as possible and without breaking the tree. Unfortunately, we can't manage the flow of bugs coming and the list is growing too quickly.
Stabilizing and keywording is a big work. Fauli have explained it a few weeks ago in a blog entry.

So if you have a PowerPC and you want to help, you can and we will appreciate it !
First of all, look at the Gentoo/PPC testing doc. Some things may be outdated, consider essentially the procedures.

I've made some bug lists to make the life of everybody easier:
- stabilization requests
- keyword requests
- security bugs

Please, refer to the Gentoo/PPC testing doc if you want to help on one of these bugs.

Do not hesitate to come see us on #gentoo-powerpc on freenode.