Mapping mouse buttons to keys or commands in KDE Plasma

So see here: How can I map keyboard buttons to my mouse buttons?.

Some notes: run the `xev` program to open up an X11 window which reports on its inputs (keypresses etc).

Reload xbindkeys with: `killall xbindkeys && xbindkeys -f ~/.xbindkeysrc`

Edit the ~/.xbindkeysrc file to program mouse button events. Get the mouse button number from the `xve` command above.

Send multiple keypress events with `xte` with for example `xte ‘keydown Alt_L’ ‘key Tab’ ‘keyup Alt_L’`

At the moment my .xbindkeysrc looks like this:

"dolphin ~/desktop"
     b:9

"xte 'keydown Alt_L' 'key Tab' 'keyup Alt_L'"
     b:8

"konsole --profile localhost"
     b:10

"kstart5 --activate --window . firefox"
     b:2

Note: b:10 above doesn’t actually work with my ROG Gladius II mouse, there doesn’t seem to be a button for buttons 10 and 11. The extra thumb button on the left at the bottom is the “DPI target button”, it’s handled on the mouse and changes mouse sensitivity, it’s not sent as a button to the workstation. You can read more about the ROG Gladius II.

Installing Kubuntu

So basically I want to run KDE Plasma under Ubuntu and this can be called Kubuntu.

This article is a little bit cargo-clutish. I.e. “I did this and it seemed to work.” and “I don’t do this because it didn’t seem to work.”

I have a pretty heavy reliance on Salt Stack for system configuration. My salt config is all built around Ubuntu 18.04 LTS.

When I need to install a Kubuntu desktop, this is how I do it:

  1. install Ubuntu Server 18.04 LTS from live installer
  2. apt update && apt dist-upgrade && apt autoremove && reboot
  3. apt install kubuntu-desktop && reboot
  4. apt install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 && reboot
  5. apt install salt-minion
  6. vim /etc/salt/minion_id
  7. vim /etc/salt/minion.d/minion.conf
    • master: salt.staticmagic.net
  8. service salt-minion restart
  9. salt-call state.highstate

Note that if your Kubuntu install is a VirtualBox guest you need to start it with a normal start if you want the shared clipboard to work. If you start headless or detachable the shared clipboard will not work (in my experience).

If your Kubuntu install is not a VirtualBox guest you can skip the virtualbox-guest-* package installation above.

Adding weekday to Date column in Dolphin in KDE on Debian GNU/Linux

cd /usr/share/i18n/locales
cp en_AU en_JJ
vim en_JJ

Change metadata:

title      "English locale for John Elliot V"
language   "John's English"

And prefix d_fmt with:

d_fmt "<U0025><U0061><U0020>

Then:

sudo localedef -f UTF-8 -i en_JJ en_JJ.UTF-8

Then:

vim /etc/environment

add add:

LC_TIME="en_JJ.UTF-8"

KDE Plasma Desktop hacks

I managed to get my desktop settings so that files on the desktop were sorted automatically. But I didn’t want that. I edited the ~/.kde/share/config/plasma-desktop-appletsrc file and set the sortingStrategy=0 and that disabled automatic alphabetical desktop sorting.

I wanted to run an application on my desktop when I dropped some files on it. To do that I created a process.desktop file like this:

#!/usr/bin/env xdg-open
[Desktop Entry]
Icon=unknown
Name[en_US]=process
Name=process
Type=Application
Exec=/home/jj5/bin/tmp/process-test %F

Note the “%F” to receive the file list. More information here and here.