You are not logged in.

#1 2020-09-25 13:24:47

sleekmason
Member
Registered: 2018-05-22
Posts: 209

Urxvt (rxvt-unicode) re-revisited

After seeing a couple of posts about different terminal emulators, I thought we should have a dedicated post for the urxvt terminal.  Low footprint, versatile, and fun.

As simple as:

sudo apt install rxvt-unicode

Here is my current configuration that can be used as a base if you would like.  Hopefully others will share theirs as well. The color scheme is fairly basic but works well for my needs, and can easily be changed to suit yours. 
This configuration gives true transparency as well as resizing fonts on the fly with a simple perl script. (link below).

Per the author of urxvt, the settings can be placed in:

~/.Xdefaults

You will likely need to create the file.

*NOTE

For BunsenLabs in particular, Package bunsen-config installs /usr/share/bunsen/skel/.Xresources, to be copied to your home directory, and any changes or additions then made to

~/.Xresources

instead. 
BunsenLabs has some urxvt settings already in place to match the Lithium theme. Conflicts could arise with colors and such from using both sources.

Here are some settings to get started with.  Urls are set to open in Firefox-esr, and can be changed to whatever you would like to use.

!--- Window Settings
Xcursor.size:11
URxvt.buffered:             true
URxvt.geometry:             85x30

!--- Font Size and Controls
URxvt*.font:  xft:DejaVu Sans Mono:autohint=true:pixelsize=12
URxvt.perl-lib:                     ~/.urxvt/ext
URxvt.keysym.C-Up:     font-size:increase
URxvt.keysym.C-Down:   font-size:decrease
URxvt.keysym.C-S-Up:   font-size:incglobal
URxvt.keysym.C-S-Down: font-size:decglobal
URxvt.keysym.C-equal:  font-size:reset
URxvt.keysym.C-slash:  font-size:show
!URxvt.perl-ext-common: font-size,tabbed,matcher
URxvt.perl-ext-common: font-size,matcher

!--- For Tabs
URxvt.tabbed.reopen-on-close: yes
URxvt.keysym.Control-Shift-Left: perl:tabbedex:move_tab_left
URxvt.keysym.Control-Shift-Right: perl:tabbedex:move_tab_right
URxvt.keysym.Control-Shift-R: perl:tabbedex:rename_tab

!---Make url links clickable
URxvt.url-launcher: /usr/bin/firefox-esr
URxvt.matcher.button: 1
URxvt.matcher.rend.0: Uline Bold fg5

!--- Scrolling
URxvt*.scrollTtyOutput:     false
URxvt*.scrollWithBuffer:    false
URxvt*.scrollTtyKeypress:   true
URxvt.secondaryScroll:      true
URxvt*scrollstyle:          plain
URxvt*saveLines:            10000
URxvt.scrollBar_right:      true
URxvt.scrollBar:            false
URxvt.mapAlert:             true

!---Transparency and effect settings
! URxvt*inheritPixmap:        true
! URxvt*transparent:          true
!---With Compositor enabled:
URxvt.depth: 32
URxvt.background: rgba:0000/0000/0000/bbbb


!---URxvt*shading: 0 to 99 darkens, 101 to 200 lightens
! URxvt*shading:              20
URxvt.blurRadius:           40
URxvt.fading:               0
! URxvt.tintColor:            #ffffff

!--- Tabbing Menu colors

URxvt.tabbed.tabbar-bg:     0
URxvt.tabbed.tabbar-fg:     6
URxvt.tabbed.tab-bg:        0
URxvt.tabbed.tab-fg:        5

!--- Colors

URxvt.cursorColor:          #06D5FF
URxvt.pointerColor:         #15ACCC
! URxvt.background:         #000000
URxvt.foreground:           #CEFAF9
URxvt.underlineColor:       #DE9D00
URxvt.throughColor:         #57AABA
URxvt.highlightColor:       #34BEBC
URxvt.color0:               #000000
URxvt.color1:               #15ACCC
URxvt.color2:               #15ACCC
URxvt.color3:               #15ACCC
URxvt.color4:               #06D5FF
URxvt.color5:               #15ACCC
URxvt.color6:               #15ACCC
URxvt.color7:               #CEFAF9
URxvt.color8:               #15ACCC
URxvt.color9:               #F5F500

!--prompt(name)
URxvt.color10:              #74EDFA

!--urls
URxvt.color11:              #F439A8

!--folder name
URxvt.color12:              #10C610

URxvt.color13:              #06D5FF
URxvt.color14:              #174413
URxvt.color15:              #174413

There are a couple of example color schemes in the man pages. Use pcat to keep out of scroll hell.

man -Pcat urxvt
man -Pcat 7 urxvt 

Find the perl extension for text sizing here: https://github.com/majutsushi/urxvt-font-size

Click on releases to the right, and choose either the zip file or tar to download.

unpack the file (tar -xaf, or unzip) and place the resultant folder in ~/urxvt/ext
You will need to make this folder as well.

That's it!  You should now be able to increase the font size on the fly with Control+up or down.


In order to track any configuration changes on the fly, keep an instance open and use:

xrdb ~/.Xdefaults

to update ~/.Xdefaults and see changes in the new terminal instance.


For menus and keybinds, using:

urxvt

will open a new terminal.  To show you a working example, here's what I use in a keybind to open urxvt at the top left of the screen, without borders, and opening into the kernel folder I use for compiling. (tilda style:)

urxvt -bl -g 80x28+10+5 -cd ~/kernels

Setting the geometry is standard, with the 80x30 being the window size, and the 10+5 being the window location on your screen.

Would love to see other ideas, tricks and hints for urxvt!

Links:
Options -  http://pod.tst.eu/http://cvs.schmorp.de … od#OPTIONS
Frequently asked questions - http://pod.tst.eu/http://cvs.schmorp.de … rxvt.7.pod
Online editor! - https://terminal.sexy/#AAAAhezqAAAAFazM … tongue.png

Last edited by sleekmason (2020-09-26 03:26:31)

Offline

#2 2020-09-25 13:44:15

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,960

Re: Urxvt (rxvt-unicode) re-revisited

FTR here's my old urxt config. Note the extra shortcuts to dynamically adjust font size and my favourite shortcut, "go 1 directory up".

If you use "xdg-open" (or whatever xdg command your desktop environment provides) as the URL launcher and add an extra pattern as descriped here https://www.systutorials.com/docs/linux … t-matcher/, you'll also be able to open URLs like file:/// to launch file browsers.

Another important thing are skipScroll and jumpScroll. These are necessary to get good performance if you have tools spitting out lots of lines.


URxvt.cutchars:                     "'*,<>[]{}|-_@:/()│"
URxvt.font:                         xft:Fantasque Sans Mono:style=Regular:size=15,\
                                    xft:IPAGothic:antialias=true,\
                                    xft:DejaVu Serif
URxvt.boldFont:                     xft:Fantasque Sans Mono:style=Bold,\
                                    xft:IPAGothic:style=bold:antialias=true,\
                                    xft:DejaVu Sans Mono:style=bold,\
                                    xft:DejaVu Serif:style=bold
! letterSpace size=14 -> -2
URxvt.letterSpace:                  -1
URxvt.italicFont:                   xft:Fira Sans:style=Italic
URxvt.boldItalicFont:               xft:Fira Sans:style=Medium Italic
URxvt.scrollBar:                    False
URxvt.jumpSchroll:                  True
URxvt.skipScroll:                   True
URxvt.secondaryScroll:              True
URxvt.saveLines:                    4096
URxvt.underlineColor:               #bf5656
URxvt.perl-ext-common:              default,matcher,font-size,confirm-paste
URxvt.keysym.C-Up:                  font-size:increase
URxvt.keysym.C-Down:                font-size:decrease
URxvt.url-launcher:                 /usr/bin/xdg-open
URxvt.matcher.button:               1
URxvt.keysym.M-Up:                  cd ..\n

Per aspera ad astra.

Offline

#3 2020-09-25 17:34:56

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 685

Re: Urxvt (rxvt-unicode) re-revisited

sleekmason wrote:

Urxvt requires a bit of setup to look decent and have extra bells and whistles. The location for the config file is:

~/.Xdefaults

No need to create ~/.Xdefaults for urxvt-settings, in BunsenLabs.
Urxvt can also read section for urxvt in ~/.Xresources.
Package bunsen-config installs /usr/share/bunsen/skel/.Xresources, which is copied to ~/.

Settings for tabbs is not in the default settings, must be added if you prefer tabbed terminal.


// Regards rbh

Offline

#4 2020-09-25 19:38:17

sleekmason
Member
Registered: 2018-05-22
Posts: 209

Re: Urxvt (rxvt-unicode) re-revisited

twoion wrote:

FTR here's my old urxt config. Note the extra shortcuts to dynamically adjust font size and my favourite shortcut, "go 1 directory up".

If you use "xdg-open" (or whatever xdg command your desktop environment provides) as the URL launcher and add an extra pattern as descriped here https://www.systutorials.com/docs/linux … t-matcher/, you'll also be able to open URLs like file:/// to launch file browsers.

Another important thing are skipScroll and jumpScroll. These are necessary to get good performance if you have tools spitting out lots of lines.


URxvt.cutchars:                     "'*,<>[]{}|-_@:/()│"
URxvt.font:                         xft:Fantasque Sans Mono:style=Regular:size=15,\
                                    xft:IPAGothic:antialias=true,\
                                    xft:DejaVu Serif
URxvt.boldFont:                     xft:Fantasque Sans Mono:style=Bold,\
                                    xft:IPAGothic:style=bold:antialias=true,\
                                    xft:DejaVu Sans Mono:style=bold,\
                                    xft:DejaVu Serif:style=bold
! letterSpace size=14 -> -2
URxvt.letterSpace:                  -1
URxvt.italicFont:                   xft:Fira Sans:style=Italic
URxvt.boldItalicFont:               xft:Fira Sans:style=Medium Italic
URxvt.scrollBar:                    False
URxvt.jumpSchroll:                  True
URxvt.skipScroll:                   True
URxvt.secondaryScroll:              True
URxvt.saveLines:                    4096
URxvt.underlineColor:               #bf5656
URxvt.perl-ext-common:              default,matcher,font-size,confirm-paste
URxvt.keysym.C-Up:                  font-size:increase
URxvt.keysym.C-Down:                font-size:decrease
URxvt.url-launcher:                 /usr/bin/xdg-open
URxvt.matcher.button:               1
URxvt.keysym.M-Up:                  cd ..\n

This is cool!  I will have to try a few of these settings:) I'll have to check out using matcher. It looks pretty neat as well:)

rbh wrote:

No need to create ~/.Xdefaults for urxvt-settings, in BunsenLabs.
Urxvt can also read section for urxvt in ~/.Xresources.
Package bunsen-config installs /usr/share/bunsen/skel/.Xresources, which is copied to ~/.

Settings for tabbs is not in the default settings, must be added if you prefer tabbed terminal.

Thank you!  I had left out about probably needing to create the file:) Does creation of  ~./Xdefaults in Bunsenlabs causes some sort of conflict? If so, I will be happy to point that out in the opening post. Seems like a good place to isolate urxvt settings though.

Last edited by sleekmason (2020-09-25 19:39:55)

Offline

#5 2020-09-25 21:37:49

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 685

Re: Urxvt (rxvt-unicode) re-revisited

sleekmason wrote:

Does creation of  ~./Xdefaults in Bunsenlabs causes some sort of conflict? If so, I will be happy to point that out in the opening post.

Maybe not. Maybe it is not read if you keep ~/.Xresources.

Seems like a good place to isolate urxvt settings though.

Neither ~/.Xdefaults nor ~/.Xresources is for only urxvt settings. But, it seams that ~/.Xdefaults, is the old config file. Better use ~/.Xresources only. See Xdefaults versus Xresources

~/.Xdefaults is not listed in debian wiki, just  ~/.Xresources: https://wiki.debian.org/Xresources


// Regards rbh

Offline

#6 2020-09-25 21:53:09

sleekmason
Member
Registered: 2018-05-22
Posts: 209

Re: Urxvt (rxvt-unicode) re-revisited

rbh wrote:
sleekmason wrote:

Does creation of  ~./Xdefaults in Bunsenlabs causes some sort of conflict? If so, I will be happy to point that out in the opening post.

Maybe not. Maybe it is not read if you keep ~/.Xresources.

Seems like a good place to isolate urxvt settings though.

Neither ~/.Xdefaults nor ~/.Xresources is for only urxvt settings. But, it seams that ~/.Xdefaults, is the old config file. Better use ~/.Xresources only. See Xdefaults versus Xresources

~/.Xdefaults is not listed in debian wiki, just  ~/.Xresources: https://wiki.debian.org/Xresources

Hmm.  yeah... no.
Here is what the author or rxvt-unicode has to say from Feb 2019.  Looks good to me. And while of course, ~/.Xdefaults is not only for urxvt, creating the file and slapping the above code into it seems pretty easy to me, but you do your thing.

 You can set and change the resources using X11 tools like xrdb. Many
       distribution do also load settings from the ~/.Xresources file when X
       starts. urxvt will consult the following files/resources in order, with
       later settings overwriting earlier ones:

         1. app-defaults file in $XAPPLRESDIR
         2. $HOME/.Xdefaults
         3. RESOURCE_MANAGER property on root-window of screen 0
         4. SCREEN_RESOURCES property on root-window of the current screen
         5. $XENVIRONMENT file OR $HOME/.Xdefaults-<nodename>
         6. resources specified via -xrm on the commandline

       Note that when reading X resources, urxvt recognizes two class names: Rxvt
       and URxvt. The class name Rxvt allows resources common to both urxvt and
       the original rxvt to be easily configured, while the class name URxvt
       allows resources unique to urxvt, to be shared between different urxvt
       configurations. If no resources are specified, suitable defaults will be
       used. Command-line arguments can be used to override resource settings. The
       following resources are supported (you might want to check the urxvtperl(3)
       manpage for additional settings by perl extensions not documented here):

Offline

#7 2020-09-26 00:37:08

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,326
Website

Re: Urxvt (rxvt-unicode) re-revisited

sleekmason wrote:
rbh wrote:
sleekmason wrote:

Does creation of  ~./Xdefaults in Bunsenlabs causes some sort of conflict? If so, I will be happy to point that out in the opening post.

Maybe not. Maybe it is not read if you keep ~/.Xresources.

Seems like a good place to isolate urxvt settings though.

Neither ~/.Xdefaults nor ~/.Xresources is for only urxvt settings. But, it seams that ~/.Xdefaults, is the old config file. Better use ~/.Xresources only.

...while of course, ~/.Xdefaults is not only for urxvt, creating the file and slapping the above code into it seems pretty easy to me, but you do your thing.

Well, as rbh pointed out, BunsenLabs already ships an .Xresources file, with a set of config lines for urxvt (colours matching the Lithium theme). For general users, the easiest thing is probably to compare those entries with your suggestions (and twoion's) and edit accordingly.

Urxvt might read .Xdefaults too, but that behaviour is non-standard and might change in the future. Keeping everything in one file seems to me simpler.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#8 2020-09-26 00:56:10

sleekmason
Member
Registered: 2018-05-22
Posts: 209

Re: Urxvt (rxvt-unicode) re-revisited

johnraff wrote:

Well, as rbh pointed out, BunsenLabs already ships an .Xresources file, with a set of config lines for urxvt (colours matching the Lithium theme). For general users, the easiest thing is probably to compare those entries with your suggestions (and twoion's) and edit accordingly.

Urxvt might read .Xdefaults too, but that behaviour is non-standard and might change in the future. Keeping everything in one file seems to me simpler.

I have no issue with any of the above.  Use whatever you wish.  I will adjust the op to state such for Bunsenlabs.

Offline

#9 2020-09-26 02:26:37

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,326
Website

Re: Urxvt (rxvt-unicode) re-revisited

Anyway, share your appreciation of urxvt - it's my default choice - and thanks for the configs, many of which I didn't know about!


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#10 2020-09-26 03:38:10

sleekmason
Member
Registered: 2018-05-22
Posts: 209

Re: Urxvt (rxvt-unicode) re-revisited

johnraff wrote:

Anyway, share your appreciation of urxvt - it's my default choice - and thanks for the configs, many of which I didn't know about!

Just one of those super neat programs with endless options:) using a dark theme allows it all to blend nicely when using without borders and such. Looks really neat having a build of some sort cascading down the desktop while doing other stuff in the foreground. smile
Would love a way to reproduce the "roll up" "drop down" effect through a key bind as well.

Offline

#11 2020-09-26 17:24:41

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,107
Website

Re: Urxvt (rxvt-unicode) re-revisited

Also one of the few (if not the only) term i know that can be setup with user defined line space easily without hacks on the font level.

URxvt.lineSpace: 6

Offline

#12 2020-09-26 17:47:50

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,960

Re: Urxvt (rxvt-unicode) re-revisited

brontosaurusrex wrote:

Also one of the few (if not the only) term i know that can be setup with user defined line space easily without hacks on the font level.

URxvt.lineSpace: 6

kitty also does support this:  adjust_line_height, adjust_column_width https://sw.kovidgoyal.net/kitty/conf.html


Per aspera ad astra.

Offline

#13 2020-09-26 21:26:45

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,107
Website

Re: Urxvt (rxvt-unicode) re-revisited

^Neat. Irc kitty needs modern hardware/drivers?

Last edited by brontosaurusrex (2020-09-26 21:27:51)

Offline

#14 2020-09-27 08:48:16

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,960

Re: Urxvt (rxvt-unicode) re-revisited

brontosaurusrex wrote:

^Neat. Irc kitty needs modern hardware/drivers?

It works fine if your graphics card has passable OpenGL support on Linux. I'm using an embedded Intel HD4400 from 2014, so that works. All graphics chips after that from Intel, AMD or Nvidia should work perfectly. Before that, no idea.


Per aspera ad astra.

Offline

Board footer

Powered by FluxBB