Introduction
URxvt is a customizable terminal emulator forked from rxvt. Features of rxvt-unicode include international language support through Unicode, transparency, the ability to display multiple font types and support for Perl extensions. URxvt is one of the most popular terminal emulator in UNIX world, especially on Unixporn. It’s well known for being lightweight and riceable. But just like any other software in UNIX world, it’s ugly out of the box. So, we should configure it before we use it. URxvt configurations is commonly placed in ~/.Xresources file. We will edit it. But first, we need to install it first.
Installation
I use Debian, so the command to install it is:
|
|
rxvt-unicode is the package name of URxvt. And xsel is a clipboard manager, I install it because URxvt is not shipped with copy paste by default. We will combine it with a Perl extension to send the marked text to xsel. You can get it from Muennich’s urxvt-perls repository. Some extensions marked as deprecated, but it still works for me without any issue.
|
|
Enter the urxvt-perls folder, then copy keyboard-select, clipboard, and url-select to ~/.urxvt/ext
Configurations
Now create a file called ~/.Xresources. Then open it using your favourite text editor. In the several first lines, I put the terminal colorscheme. Colorscheme is one of most important part of terminal customization. URxvt uses base16 style colorscheme. It stores background color, foreground color, cursor color, black, red, green, yellow, blue, magenta, cyan, and white. Actually it could store more color for bold, underline, and many others. But I let it to be default, it will take color from other stored colors automatically.
|
|
It’s my selfmade colorscheme, not very good. You can do some experiment with colorscheme by yourself later. Or maybe you could visit https://terminal.sexy to get some colorscheme examples. But now, we need to configure the appearance first.
|
|
URxvt has an ability to load
XLFD for bitmap font.
It’s a custom font by the way, and I haven’t uploaded it.
So, please replace -*-rissole-*
with other font.
Maybe with Iosevka font.
It’s beautiful and currently rising in popularity.
Iosevka is an xft font. So, the configuration syntax like this..
|
|
I have uploaded the fonts and write the description in this post
You can get the xft name using fc-list
command.
|
|
Replace Iosevka with the other font name you want. Letterspace variable handles the space between characters. Linespace variable handles the linespacing between characters vertically. Geometry handles the URxvt size on launch. InternalBorder handles the terminal paddings, for aesthetic reason. But don’t set the paddings too much, we should care about usability too. CursorBlink true makes the cursor blinking, for visibility reason. CursorUnderline makes the block cursor became an underline, but I set it to false for now. The underline on this version of URxvt is too thin (I’m still using the old version because I’m on Debian Jessie), and nearly invisible. It also vanishes on full-pipe character. But those problems have been fixed on the newer version of URxvt. UrgentOnBell makes URxvt to be able to send need-an-attention signal to window manager / taskbar. Depth: 24 makes URxvt couldn’t use true transparency, because I don’t need it. You could change it to Depth: 32 to enable true transparency support. Iso14755: false to disable the annoying warning about Iso type. Now let’s configure some keybinds those are not available on URxvt by default, but I can’t live without.
|
|
- Shift Up to scroll one line higher
- Shift Down to scroll one line lower
- Control Left to jump to the previous word
- Control Right to jump to the next word
|
|
Remember the Perl Extensions we copied before? Now it’s the time to load them and make keybinds to call them. M means meta, or in these modern days called Alt. To copy some text in the terminal, mark them using mouse then hit Alt+C. To paste it to URxvt, hit Alt+V. But if you want to paste it on the other app, just use Ctrl+V normally. That Perl Extension also contains other useful features. Like select URL in terminal by pressing Alt+U, then use arrow keys if there are more than one URL in current buffer. Then hit Enter to launch the selected URL in Firefox. Hit Esc to exit selection mode.
Conclusion
So, my full URxvt configurations look like this.
|
|
Don’t forget, after modifying ~/.Xresources file,
You need to reload it using xrdb ~/.Xresources
command.
And the change of URxvt will be applied on next launch.
Thanks for reading!