blututto.py | ||
pyproject.toml | ||
README.md | ||
sample-config.json |
blututto
blututto
is a simple python script to run commands from generic keypressure. Differently than other (better)
tools like xchainkeys
, xbindkeys
, sxhkd
, etc. It supports specifying the device.
This is extremely useful in companion with special remotes like the AB Shutter3
or probably many others
Setup
I will not digress on how to setup bluetooth, pairing, etc. Bluetooth is a mess, and I'm not the one understanding it. Try hard, and at some point you will find it
Quick run
sudo python3 ev.py -n 'AB Shutter3 Consumer Control' --debug
will tell you something. Please note that not all the shutters you will find online are programmed to send the same keycode. So look at the debug messages, and see what happens if you press any key. This is the output I have:
INFO:root:Found device: /dev/input/event7
DEBUG:root:device /dev/input/event7, name "AB Shutter3 Consumer Control", phys "6C:71:D9:57:7F:48"
INFO:root:start loop
DEBUG:root:received key event at 1595169257.015336, 115 (KEY_VOLUMEUP), down
DEBUG:root:received key event at 1595169257.195282, 115 (KEY_VOLUMEUP), up
DEBUG:root:(115, 'short')
You can see that the shutter I bought sends the key "volume up", whose code is 115
. So that's what you need
to put in your configuration file.
Better run
You might have noticed that I ran the script with sudo
. That's not good, and not strictly needed. First
solution: sudo useradd $USER input
and voilà! But maybe that's still too much...
better adding a udevrule. Match on
ATTRS{name}=="AB Shutter3 Consumer Control"
and apply mode 0640 and set the group to $(id -gn)