Package: cecmap
Maps CEC events to arbitrary keybindings for controlling your raspberrypi desktop via TV remote.InstallYou can installcecmapas user or root:as user:pip3 install --user cecmapAlso, make sure to add~/.local/binto your PATH.as root:sudo pip3 install cecmapIn order to see notifications when switching modes, it’s also necessary to
have a notification daemon installed. I recommendxfce4-notifyd:sudo apt install xfce4-notifydI also recommend installing an onscreen keyboard, e.g.:sudo apt install matchbox-keyboardUsageLaunch:cecmap

# or:

python -m cecmapRunning as serviceEnable running at startup:systemctl --user enable cecmapStart as service:systemctl --user start cecmapDefault keybindingscecmapcomes configured with default aKeyboardandMousemode to get
you started (seececmap/config/default.cfg). You can freely change these
keybindings and add or override modes using the config format, seeConfiguration. The default keybindings are as follows:KeyMousemodeKeyboardmode🔵 F1 blueswitch modeswitch mode🔴 F2 redlaunchmatchbox-keyboard<Win>🟢 F3 greenmouse wheel uplaunch kodi🟡 F4 yellowmouse wheel downlaunchchromium-browser🡅 upmove cursor up<up>🡇 downmove cursor down<down>🡄 leftmove cursor left<left>🡆 rightmove cursor right<right>🆗 selectleft click<enter>▶ playmiddle click<media_play_pause>⏸ pauseright click<media_play_pause>⮨ exit<esc><esc>Configurationcecmapuses a simple config format to set keycodes and keybindings. The
config to be used can be specified on the command line using the-cFILE.cfgoption. The format is as follows:[keycode]KEY=<NUMBER>...[mode.NAME]KEY=<command> [<args>...]...e.g.:[keycode]left=123yellow=321...[mode.Keyboard]left=key leftyellow=launch kodi...For a more realistic example, seececmap/config/default.cfg.If multiplemodesare defined, make sure to define a keybinding that
executes theswitchcommand. This is most easily done in the special
section[mode.*]that can be used to define fallbacks bindings that apply
globally to all modes.cecmapwill be started in the topmost declared mode, and
cycle through modes in the order of their appearance.Multiple config files can be passed. In this case the configuration is merged
sequentially with later files overriding earlier ones. This can be used to
e.g. load keycodes and keybindings from different files:cecmap \
    -c keycodes.cfg \
    -c mousemode.cfg \
    -c keymode.cfgIf no-cCONFIGoption is passed on the command line,cecmapchecks user
and system, or default configuration and uses the first that exists:$XDG_CONFIG_HOME/cecmap.cfg(defaulting to~/.config/cecmap.cfg)/etc/cecmap.cfgcecmap/config/default.cfg(distributed with the package)CommandsCurrently, the following commands are supported as right hand sides of
keybindings:Commandslaunch <command>[<args>...]Start the given program. You can use shell-like quoting to pass
arguments with spaces in them.toggle <command>[<args>...]Start the given program with command line options. If we have
previously started the program, terminate it. Useful for commands such
asmatchbox-keyboard.key<name>|<keycode>|@<letter>Type the specified key. For a list of key names, seeKey.buttonleft|middle|right|<number>Perform a mouse click using the specified button. More button names
are available, seeButton.scroll up|down|left|right [<ticks>]Scroll the mouse wheel in the specified direction a specified number
of scroll ticks (default = 1).motion up|down|left|rightPerform a mouse cursor motion along the given direction while the key
is pressed.switch [<mode>]Switch to the specified<mode>, or if this optional argument is
omitted, cycle through modes in the order of their appearance in the
config files.KeycodesIf the default keycodes do not work as expected, you can configure the
keycodes specific to your setting. In order to determine which key corresponds
to which keycode, open a terminal and execute:cec-clientWatch the output as you press buttons, and write down the keycodes for the
config file.Reloadingcecmapcan be told to reload the config by sendingSIGUSR1, e.g.:pkill -USR1 cecmapor, if started as a service:systemctl --user reload cecmapChangesv1.0.0Date: 28.11.2021rename to cecmapswitch default keybindings for F1 (blue) and F4 (yellow)add keycodes for all user control codes defined by CECv0.0.5Date: 27.11.2021fix KeyError if a motion-bound key was already pressed before starting
picec but released afterwardsset/decrease notification timeout to 3smove code to picec.cli submoduleremove ability to load .py config filesadd ability to load .cfg config filesadd ability to reload config on the fly using SIGUSR1add ability to merge config from multiple .cfg filesdocument config formatv0.0.4Date: 26.11.2021fix: TypeError: __init__() missing 1 required positional argument: ‘app_name’fix: AttributeError: ‘dict’ object has no attribute ‘setup’fix: AttributeError: module ‘os’ has no attribute ‘setpgrgp’v0.0.3Date: 25.11.2021spawn subprocesses in new process group
(to avoid tearing them down with us when we are stopped)execute viabash-lin .service file to ensure PATH customizations are
available. This may fix an error when autostarting the service, and will
be useful for launching locally installed applications.move code to package structureuse entrypoint for creating the executablerename executable frompicec.pytopicecadd command line option to change config
(undocumented so far, and the API will change!)load config from~/.config/picec/config.pyif existssimplify configbindmatchbox-keyboardto red button in mouse modeadd notification about mode changes using notify2v0.0.2Date: 22.11.2021replace xdotool bypynputmake .service restart on failurev0.0.1Date: 22.11.2021Initial prototype:hard coded keybindingsfor LG TV with magic remote“mouse” and “keyboard” mode for controlling the mouse or cursor keysbased on xdotoolincludes an example .service file