Monday, November 26, 2018

Linux and mouse buttons, assigning functions, VNC cut and paste







In most distros you can assign menu functions to mouse buttons via system settings.

What I'm wanting to do is make the left mouse button select and the right button paste.  Here's how:

 xmodmap ~/.xmodmap

and in the .xmodmap we have:

!
! Swap Caps_Lock and Control_L
!
keycode 109 = Multi_key
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
!
! mouse control
!
pointer = 1 3 2 4 5

The above first swaps the control and caps lock key, I grew up with Sun keyboards and that's the way it should be, next the "pointer" statement swaps the right and middle buttons for paste.

VNC cut and paste fun.  Most forums advise running vncconfig to resolve you cut and paste issues, however if you're running a Linux KDE desktop and multiple VNC viewer windows like I do, having vncconfig running on anywhere screws cut and paste up.  I found killing off vncconfig makes cut and paste between all windows work just fine.

Or not!  Further investigation seems to indicate KDE Klipper is the problem.  Having KDE running inside a VNC session seems to cause issues with cut and paste, killing Klipper seems to have fixed the problem.



Sunday, June 17, 2018

Linux - no sound after upgrade


The old 2 headed display
On Fedora 25;

Few days ago I upgraded my kernel, easy process, but my second monitor stopped working.  I didn't care much and wasn't going to spend any time fixing it since I was going to order a single larger monitor anyway, so I went back to the older kernel.  When I hooked up the new monitor and booted the new kernel I noticed sound wasn't working.  Long Google hunt later, with no correct answers found, I noticed for the fully working kernel I had a second packaged called  "kernel-modules-extra".

Sure enough, installing "kernel-modules-extra" with a version number which matched the new kernel fixed the sound problem, and likely would have fixed the the second monitor problem too.

You can test for this problem using "aplay -a", if you get a "no sound cards found" message then likely you have a kernel/driver issue which may be solved by installing the correct version of the "kernel-modules-extra" package.

locnar<132>% rpm -qa | grep -i kernel

kernel-headers-4.9.6-200.fc25.x86_64
kernel-core-4.13.16-100.fc25.x86_64
kernel-core-4.9.6-200.fc25.x86_64
kernel-core-4.1.13-100.fc21.x86_64
kernel-modules-4.13.16-100.fc25.x86_64
kernel-modules-extra-4.9.6-200.fc25.x86_64
kernel-4.1.13-100.fc21.x86_64
kernel-modules-extra-4.13.16-100.fc25.x86_64
kernel-4.9.6-200.fc25.x86_64
abrt-addon-kerneloops-2.9.0-1.fc25.x86_64
kernel-modules-extra-4.1.13-100.fc21.x86_64
kernel-modules-4.1.13-100.fc21.x86_64
kernel-debug-devel-4.9.6-200.fc25.x86_64
kernel-modules-4.9.6-200.fc25.x86_64
libreport-plugin-kerneloops-2.8.0-1.fc25.x86_64



The new 4k curved display