pages tagged urxvtNico Schotteliushttps://www.nico.schottelius.org//tags/urxvt/Nico Schotteliusikiwiki2016-02-25T13:34:32ZHow to change the colour of ls to work with bright terminal backgroundshttps://www.nico.schottelius.org//blog/change-colour-for-ls-to-work-with-bright-terminal-background/2016-02-25T13:34:32Z2015-06-01T18:24:23Z
<h2>Introduction</h2>
<p>I am using <a href="http://software.schmorp.de/pkg/rxvt-unicode.html">rxvt-unicode</a>
as my terminal and prefer to use a bright background due to better
readability in the sun.</p>
<p>I have tried various colour themes
(including
<a href="http://ethanschoonover.com/solarized">solarized</a> and
<a href="https://github.com/yangzetian/xresources-color-solarized-light">solarized-light</a>,
but was never satisfied, because of changes
they make to existing colour configurations for applications
like mutt, alot or irssi.</p>
<p>I am essentially using black as the foreground colour and
LightYellow2 as the background colour at the moment (which I inherit
from some very old xterm + <a href="http://www.fvwm.org/">fvwm</a>2 settings).</p>
<h2>Motivation</h2>
<p>The problem with my current setup is that symbolic links are
show in <strong>cyan</strong> by <strong><em>ls</em></strong> on my system and thus are pretty much
unreadable, as you can see:</p>
<p><a href="https://www.nico.schottelius.org//blog/change-colour-for-ls-to-work-with-bright-terminal-background/urxvt-before.png"><img src="https://www.nico.schottelius.org//blog/change-colour-for-ls-to-work-with-bright-terminal-background/urxvt-before.png" width="629" height="98" alt="urxvt with unreadable cyan colour" class="img" /></a></p>
<h2>The solution</h2>
<p>As the problem mainly arises by the use of ls, I initially thought
about modifying the <strong>LS_COLORS</strong> variable. However, as I frequently
login to servers that are variable does not effect the colour output
on the servers (and modifying AcceptEnv on all servers is also not
realistic).</p>
<p>As I do not want to have cyan output on my LightYellow2 background
at all, I thought about changing the colour cyan to black.</p>
<p>I found a nice colour table on <a href="https://wiki.gentoo.org/wiki/Rxvt%2Dunicode%23Color%5Ftheme">Rxvt-unicode#Color theme in Gentoo Wiki</a>,
with description of colour number to name:</p>
<pre><code>!black
*color0: #251f1f
*color8: #5e5e5e
!red
*color1: #eb4509
*color9: #eb4509
!green
*color2: #94e76b
*color10: #95e76b
!yellow
*color3: #ffac18
*color11: #ffac18
!blue
*color4: #46aede
*color12: #46aede
!magenta
*color5: #e32c57
*color13: #e32c57
!cyan
*color6: #d6dbac
*color14: #d6dbac
!white
*color7: #efefef
*color15: #efefef
</code></pre>
<h2>The result</h2>
<p>So in the end, only the following entries in .Xresources are
required to make cyan symbolic links readable by changing
cyan to black:</p>
<pre><code>URxvt.background: LightYellow2
URxvt.foreground: black
URxvt.color6: black
URxvt.color14: black
</code></pre>
<p>And this is how it finally looks like:</p>
<p><a href="https://www.nico.schottelius.org//blog/change-colour-for-ls-to-work-with-bright-terminal-background/urxvt-after.png"><img src="https://www.nico.schottelius.org//blog/change-colour-for-ls-to-work-with-bright-terminal-background/urxvt-after.png" width="612" height="95" alt="urxvt with cyan changed to black" class="img" /></a></p>
<h2>SEE ALSO</h2>
<ul>
<li><a href="http://ciembor.github.io/4bit/">Terminal Colours</a></li>
<li><a href="https://wiki.archlinux.org/index.php/X%5Fresources">X resources in Arch Linux Wiki</a></li>
<li><a href="https://wiki.archlinux.org/index.php/Rxvt%2Dunicode">Rxvt-unicode in Arch Linux Wiki</a></li>
</ul>
How to change the font in urxvt (rxvt-unicode) dynamicallyhttps://www.nico.schottelius.org//blog/urxvt-change-font-dynamically/2016-02-25T13:34:32Z2015-02-03T14:47:26Z
<p>After <a href="https://www.nico.schottelius.org//blog/published-xorg-terminal-emulator-fonts/">I had a look at some fonts for terminal emulators</a>,
I chose some of the fonts to be used for my terminal.
<a href="http://software.schmorp.de/pkg/rxvt-unicode.html">rxvt-unicode</a> has excellent support for
dynamic font changes, as described
in the <a href="http://pod.tst.eu/http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.pod#Can_I_switch_the_fonts_at_runtime">urxvt faq</a>.
I decided to write a tiny script around the printf call
named <a href="https://github.com/telmich/nsbin/blob/master/urxvt-font-change">urxvt-font-change</a>.</p>
<p>This resulted in a clean <a href="https://www.nico.schottelius.org//configs/dot-Xresources">.Xresources</a> file, which allows me to change the font
using <strong><em>Control-Alt-{1-6,0}</em></strong>.</p>