Linux and Logitech Unify Dongles

Logitech Unify was a game changer, in relation to wireless input devices (keyboards/mice).

The major problem with it is changing which dongle each of the input devices were paired with.  

I have been using their combo keyboard/mouse package since it was originally released.  It works perfectly, but the letters on the keyboard keys keep rubbing off after too much use.

This gets to the point of "How do you switch the keyboard" out with a new one?  On Windows and MacOS is easy.  Logitech provided software that can directly configure the dongle and what items are paired with it.

Unfortunately, they never released anything for Linux.  I have been using Ubuntu for the longest time, so I will explain how to configure the dongles on Ubuntu 24.04.

The first thing you need to find is a package named 'solaar' in PyPi.

If you have a Python version installed, you can run the following command and it just works:

    
    pip install solaar    
    


I would suggest going through the full installation instructions in their documentation (link below).

You can now run 'solaar' from a command prompt.  This a graphical program, but there is also command line for automation.


GUI:














Command Line:

    
    $ solaar --help
rules cannot access modifier keys in Wayland, accessing process only works on GNOME with Solaar Gnome extension installed
usage: solaar [-h] [-d] [-D PATH] [--restart-on-wake-up] [-w {show,hide,only}]
              [-b {regular,symbolic,solaar}] [--tray-icon-size TRAY_ICON_SIZE]
              [-V] [--help-actions]
              ...

positional arguments:
  {show,probe,profiles,config,pair,unpair}
                        command-line action to perform (optional); append '
                        --help' to show args

options:
  -h, --help            show this help message and exit
  -d, --debug           print logging messages, for debugging purposes (may be
                        repeated for extra verbosity)
  -D PATH, --hidraw PATH
                        unifying receiver to use; the first detected receiver
                        if unspecified. Example: /dev/hidraw2
  --restart-on-wake-up  restart Solaar on sleep wake-up (experimental)
  -w {show,hide,only}, --window {show,hide,only}
                        start with window showing / hidden / only (no tray
                        icon)
  -b {regular,symbolic,solaar}, --battery-icons {regular,symbolic,solaar}
                        prefer regular battery / symbolic battery / solaar
                        icons
  --tray-icon-size TRAY_ICON_SIZE
                        explicit size for tray icons
  -V, --version         show program's version number and exit
  --help-actions        describe the command-line actions

For more information see https://pwr-solaar.github.io/Solaar
    



Looking back at the GUI screenshot, you can see the "+Pair new device" button on the right side close to the bottom.  Click it and follow the instructions.


The question came up of "How do I pair a keyboard that is already been paired with another dongle?"  
The simple answer is:  You can't.  You can only pair a device to a single dongle.
How to make it work?:  You factory reset the keyboard and then try to pair to the new dongle.  It worked great for me.


There is a possibility to factory reset the dongle.  From what I have found (from pages linked below), you can send a command from the terminal to tell the dongle to factory reset.

<div style="background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
    <pre style="line-height: 125%; margin: 0px;">
    <span style="background-color: #fff0f0;">
# should output /dev/hidrawN where N is usually 0
hidraw=/dev/$(cd /sys/bus/hid/drivers/logitech-djreceiver/*/hidraw && echo hidraw*)
printf '\x20\xff\x81\0\0\0\0\0\0\0\0\0\0\0\0' | sudo tee "$hidraw" >/dev/null
    </span>
    </pre>
</div>



Arch Linux has a good write up about it at https://wiki.archlinux.org/title/Logitech_Unifying_Receiver


References:


solaar links:

 on pypi:              https://pypi.org/project/solaar/
 documentation:  https://pwr-solaar.github.io/Solaar/
 installation instructions:  https://pwr-solaar.github.io/Solaar/installation/
 Source on Github:  https://github.com/pwr-Solaar/Solaar

Logitech Dongle Factory Reset:

https://askubuntu.com/questions/326087/logitech-k350-keyboard-and-m510-mouse-not-working-unless-i-unplug-and-replug-don
https://bbs.archlinux.org/viewtopic.php?pid=1309535#p1309535



As always, if you have any questions, just leave a comment.


Comments

Popular posts from this blog

Bash, here-document and Python

Linux and Logitech Unify Dongles: Part 2