When I started, and having decided to use XFCE, I did originally install it with a lot of what it comes with. That is, I used the panel of course, which I still use & like very much, but also XFCE's own window manager (
xfwm4), terminal emulator (
terminal), and more.
Over time though, I did not keep using all that. I kept some things because I liked them, such as
xfwm4 (which is full of nice tricks), others I removed because I didn't see a need for (
xfce4-session), and others I replaced, like
terminal. If I decided to look for a replacement, it was because of a little bug that would regularly occur, and annoy me.
But once I found
urxvt, I realized that even if that bug got fixed, I would not go back. urxvt is really a nice terminal emulator, comes with a lot of options and I am really enjoying using it every day. It would pretty much be perfect, if it wasn't for one thing, one pretty annoying little thing...
Mouse wheel: it scrolls, and only that
As much as I use a terminal, which is obviously keyboard-driven, I still like my mouse. And I use it frequently, including when I'm using a terminal. Like pretty much all other emulators, urxvt supports using the mouse wheel to scroll in the terminal's buffer; But, unlike some others, that is all it does. Some other terminals, specifically all VTE-based terminals (such as XFCE's
terminal), allow for more.
When running an application that uses the "secondary screen"(*) those terminals will disable their scrollbar, and instead you can use the wheel to interact with said application. For example, when in
man you can scroll around using the mouse wheel. And it's a really nice thing, because it feels very natural (to me, at least).
(*) not sure whether this is the "official" term or not, but at least that's how it's called in urxvt.
And it is the one thing that always annoyed me about urxvt: even in such applications, the mouse wheel will simply scroll through urxvt's own buffer. So I finally decided to grab the source code and have a look, and lucky enough it turned out to be pretty easy to change things.
Introducing a new option: secondaryWheel (ssw)
Yeah, that name might not be the best, but it goes along side
ssc) - which is obviously required for this to work at all - as well as
ssr) - with which, IMHO, it is somewhat related. So, there you go.
What this new option does, is pretty simple: when using the mouse wheel, if you're on secondary screen then no scrolling will occur, and instead some (3, to be exact) "fake" keystrokes will be sent to the running application. So, a wheel up will have the same result as pressing the Up key three times, and wheel down will do the same as pressing 3 times the Down key.
Easy enough, but that does the trick: now when running
less or any other application that uses the secondary screen, you can use the mouse wheel to move around (or whatever said application would do, if you pressed the Up/Down keys). It should be noted that I'm not sure this is actually how things are done in VTE-based terminals - I never checked - but this does the job, so it works for me.
This is just another option (disabled by default), so you can either use it from command-line (
ssw), or specify it in your
.Xdefaults using it's long-name:
Like I mentioned earlier, I believe this option is related to
secondaryScroll, as in it works best if you disable it, while enabling
That way, not only can you use your mouse wheel to scroll around in those applications, but whatever you do here will not "mess up" your scrolling buffer (on primary screen). That's how I use it, and I really like it that way.
Clear patch, by rlblaster
And to be really perfect, there's another little change that can be done. When resetting the terminal (Ctrl+L), by default urxvt simply moves the cursor on top of the window, and clears everything that was there. Meaning that as a result, it can cut off some of your buffer, as those lines are just cleared.
To fix this, rlblaster on the Arch Linux forums shared a nice patch that will, before hand, add lines, thus allowing to keep your full scrolling buffer intact.
It looks the same, except that when scrolling up everything is there, nothing was cut.
The modified source code is available on this BitBucket repository. This is what I use, so it includes both my changes (
secondaryWheel) as well as the modifications by rlblaster (from his
For Arch Linux users, you can also find a PKGBUILD in the AUR, which uses the official source code and both patches to get there, simply because I figured it would allow people to check the changes more easily.
Note: The PKGBUILD includes both patches, and also uses different compilation options (than the official package) to disable utmp/wtmp support and tabbed support. This is mainly because I don't use those, plus I beleive that utmp/wtmp doesn't actually work anyway (it would require setuid to be set, which isn't the case in the official package. Though, I did include the required lines (commented out) in the PKGBUILD; should you want to use it, you can simply uncomment them, and don't forget to change the options as well).
And of course bug reports, suggestions or any other form of constructive criticism is very much welcome.