Skip to main content

Ralsina.Me — Roberto Alsina's website

Schizo Desktop II: Keyboard and Mouse

I have an of­fice. It's like a home of­fice but it's in an­oth­er place. It's just mine, so I get the peace and qui­et of a home of­fice but al­so get to go out­side to get there. It's a good set­up.

BUT I have two com­put­ers there. Well, ac­tu­al­ly I have like 10, but I in­ter­act with two. One is my per­son­al desk­top com­put­er, the oth­er is my work lap­top. and I want to use the same pe­riph­er­als in the same way with both of them. That's why I have the world's most com­pli­cat­ed schizo desk­top set­up.

This se­ries of posts will doc­u­ment it, the why and how of it, and the var­i­ous things I've learned along the way, along with mak­ing you want to buy weird chi­nese gad­get­s.

Today: Keyboard and Mouse

I have 2 key­boards and no mouse. In­stead of a mouse I have a track­ball but for all prac­ti­cal pur­pos­es ... 1 mouse.

A keyboard, a mouse and a tiny keyboard

How do I use them with two computers?

The an­swer is Bar­ri­er which runs a serv­er in my per­son­al ma­chine and a client in my work lap­top.

With it run­ning, I can just slide my mouse to the edge of the screen of one com­put­er and it will ap­pear in the screen of the oth­er com­put­er. It's like mag­ic.

I can even copy­/­paste be­tween them trans­par­ent­ly, I just can't move win­dows across the fron­tier for ob­vi­ous rea­son­s.

How do I use them with random computers?

My key­board has 3 mod­es:

  • Wired (al­ways con­nect­ed to my per­son­al com­put­er)
  • Blue­tooth for up to 3 de­vices (not con­nect­ed to any­thing)
  • 2.4Ghz don­gle (not con­nect­ed to any­thing)

So, if I have a ran­dom com­put­er (say, a rasp­ber­ry pi I need to de­bug) I can just switch the key­board to use the 2.4Ghz don­gle, plug it in­to the com­put­er and use it that way.

What about the tiny keyboard?

That's macros. The wheel is vol­ume, and al­so con­trols my lights and oth­er things. The but­tons do things like con­trol my air con­di­tion­er.

It's a su­per cheap chi­nese one, and they have re­cent­ly be­come con­fig­urable in Lin­ux, which is al­ways nice.

Why a trackball?

Why not a track­bal­l?

Any special keyboard configuration?

Oh yes. because it's a 65% keyboard I have to choose between having an escape key or a ~ key.

So I chose both, and mapped escape to the caps lock key.

So when I start my ses­sion I run this:

# Map caps lock and esc to proper keys
xkeysnail --watch --devices "ROYUAN GamaKay 68" .config/xkeysnail/ &
sleep 1

setxkbmap -model pc104 -layout us -variant altgr-intl -option

The xkeysnail tool configures this keyboard (and only this keyboard) using this file:

from xkeysnail.transform import *

# define timeout for multipurpose_modmap

# [Global modemap] Change modifier keys as in xmodmap
    Key.CAPSLOCK: Key.ESC,
    Key.ESC: Key.GRAVE

So I get escape in the caps lock key, and ~ in the esc key.

Then setxkbmap configures a us international keyboard layout with the altgr-intl variant, which is the one I like.


This one is not very weird, oth­er than the re­liance in a sin­gle key­board and a track­bal­l. If you use mul­ti­ple com­put­ers in your set­up I rec­om­mend Bar­ri­er, it's a great tool.

Contents © 2000-2024 Roberto Alsina