A few years back $HOUSEMATE gave me a Kensington “Expert Mouse” which is really a very nice, big trackball with an around-the-ball scroll ring. The default button mapping isn’t to my taste, but defaults are merely that, defaults. They are, and were, readily changed to an arrangement I find more sensible. The trackball is connected to the ‘desktop’ computer in the office, which is what I use the most. I got used to the new trackball quickly. Enough so that I started catching myself going for the scroll ring when using the laptop. The laptop had (as had the desktop) a rather nice Logitech “Marble Mouse” which, again, is really a trackball. That needed a bit of tweaking, too. The “middle button” of a mouse is very useful as most Linux window managers use it as PASTE (highlighting is COPY). Browsers (at least Vivaldi, don’t use other enough to be sure of recall) use it as ‘close tab’ and ‘open link in new tab’. The “middle” button isn’t really there right off, so a tweak. Way back when they were only two-button, I used a trick (it might be there, but I’ve not needed it) where a nigh-simultaneous right and left click was taken to be middle click. Alright, enough tangent.
And I found myself going for the scroll ring when visiting over Christmas. Well, I had an Amazon gift card (unrelated to Christmas), there was a bit of a sale, and I had had enough, so I bought an “Expert Mouse” for the laptop. It is now in place and working fine – after the tweak to make the buttons behave the way I want them to. So, Merry Christmas to me.
Anyone not more interested in trackballs on linux (and also getting swapped out memory back into RAM) can stop here and go read something interesting. The following is mainly so I can find these again without having to dig through things on a computer on another level of the house, or deal with ever less useful web searches.
First, a simple bit for deal with either Logitech of Kensington depending upon which line is (un)commented. No, I didn’t get fancy try and try to autodetect which one was there. Besides, during a transition it is possible for both to be connected.
The path: /usr/local/bin# more trackball.sh
#!bin/bash
#
# For Logitech "Marble Mouse"
#
# Leave main (LEFT, RIGHT) buttons alone, but make small right
# button into MIDDLE button for pasting, etc.
# Since the small buttons are 8 and 9 and gpointing-device-settings
# only goes to 8, 9 is used for middle, leaving 8 available for
# such things as scroll mode.
#
# xmodmap -e 'pointer = 1 9 3 4 5 6 7 8 2 10'
#
# ----
#
# For Kensington "Expert Mouse"
#
# Change default
#
# 2 8
# 1 3
#
# to more sane
#
# 1 2
# 8 3
#
xmodmap -e 'pointer = 8 1 2 4 5 6 7 3 9 10'
And it seems I need this and have issues finding it again every time I install a new distribution or version thereof.
The path: /usr/local/bin# more swap2ram.sh
mem=$(LC_ALL=C free | awk '/Mem:/ {print $4}')
swap=$(LC_ALL=C free | awk '/Swap:/ {print $3}')
if [ $mem -lt $swap ]; then
echo "ERROR: not enough RAM to write swap back, nothing done" >&2
exit 1
fi
swapoff -a &&
swapon -a