Categories
DailyOps

How to manage wireless Logitech devices using command-line

Manage wireless Logitech devices using command-line.

Solaar a device manager for Logitech wireless devices is already installed on Ubuntu desktop system.

Display usage information.

$ solaar --help
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,config,pair,unpair}
                        optional actions to perform

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        print help for the optional actions

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

Display devices.

➜ solaar show -h 
usage: solaar show [-h] [device]

positional arguments:
  device      device to show information about; may be a device number (1..6), a serial number, a substring of a device's name, or "all" (the
              default)

options:
  -h, --help  show this help message and exit
$ solaar show all
Solaar version 1.1.1

Unifying Receiver
  Device path  : /dev/hidraw0
  USB id       : 046d:C52B
  Serial       : 53916D9A
    Firmware   : 12.11.B0032
    Bootloader : 04.16
    Other      : AA.AA
  Has 2 paired device(s) out of a maximum of 6.
  Notifications: wireless (0x000100)
  Device activity counters: 1=150, 2=205

  1: M720 Triathlon Multi-Device Mouse
     Device path  : /dev/hidraw1
     WPID         : 405E
     Codename     : M720 Triathlon
     Kind         : mouse
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: 205F2717
     Model ID:      B015405E0000
     Unit ID:       C738473C
        Bootloader: BOT 34.01.B0005
          Firmware: MPM 04.10.B0013
             Other: 
     The power switch is located on the base.
     Supports 36 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Bootloader BOT 34.01.B0005 000000A96719
            Firmware: Firmware MPM 04.10.B0013 405E00A96719
            Firmware: Other   
            Unit ID: C738473C  Model ID: B015405E0000  Transport IDs: {'btleid': 'B015', 'wpid': '405E'}
         3: DEVICE NAME            {0005}   
            Name: M720 Triathlon Multi-Device Mouse
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: CRYPTO ID              {0021}   
         7: DEVICE FRIENDLY NAME   {0007}   
            Friendly Name: M720 Triathlon
         8: BATTERY STATUS         {1000}   
            Battery: 90%, discharging, next level 50%.
         9: CHANGE HOST            {1814}   
            Change Host        : 2:desktop
        10: HOSTS INFO             {1815}   
            Host 0 (paired): rpi
            Host 1 (paired): desktop
            Host 2 (paired): laptop
        11: REPROG CONTROLS V4     {1B04}   
            Key/Button Actions (saved): {'208': 208, '80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}
            Key/Button Actions        : {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93, '208': 208}
            Key/Button Diversion (saved): {'208': 0, '82': 0, '83': 0, '86': 0, '91': 0, '93': 0}
            Key/Button Diversion        : {'82': 0, '83': 0, '86': 0, '91': 0, '93': 0, '208': 0}
        12: PERSISTENT REMAPPABLE ACTION {1C00}   
        13: POINTER SPEED          {2205}   
            Pointer Speed: 1.0
            Sensitivity (Pointer Speed) (saved): 256
            Sensitivity (Pointer Speed)        : 256
        14: VERTICAL SCROLLING     {2100}   
            Roller type: 3G
            Ratchet per turn: 24
            Scroll lines: 0
        15: DFUCONTROL UNSIGNED    {00C1}   
        16: DFUCONTROL SIGNED      {00C2}   
        17: DEVICE RESET           {1802}   internal, hidden
        18: unknown:1803           {1803}   internal, hidden
        19: CONFIG DEVICE PROPS    {1806}   internal, hidden
        20: OOBSTATE               {1805}   internal, hidden
        21: unknown:1813           {1813}   internal, hidden
        22: unknown:1830           {1830}   internal, hidden
        23: unknown:1861           {1861}   internal, hidden
        24: unknown:1890           {1890}   internal, hidden
        25: unknown:1891           {1891}   internal, hidden
        26: unknown:18A1           {18A1}   internal, hidden
        27: unknown:1DF3           {1DF3}   internal, hidden
        28: unknown:1E00           {1E00}   hidden
        29: unknown:1EB0           {1EB0}   internal, hidden
        30: unknown:18B1           {18B1}   internal, hidden
        31: unknown:1850           {1850}   internal, hidden
        32: unknown:1E22           {1E22}   
        33: unknown:1F03           {1F03}   internal, hidden
        34: unknown:18C0           {18C0}   internal, hidden
        35: HIRES WHEEL            {2121}   
            Multiplier: 8
            Has invert: Normal wheel motion
            Has ratchet switch: Normal wheel mode
            High resolution mode
            HID notification
            Scroll Wheel Direction (saved): False
            Scroll Wheel Direction        : False
            Scroll Wheel Resolution (saved): True
            Scroll Wheel Resolution        : True
     Has 9 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, reprogrammable, pos:0, group:1, group mask:g1
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, reprogrammable, pos:0, group:1, group mask:g1
             reporting: default
         2: Middle Button             , default: Mouse Middle Button         => Mouse Middle Button       
             mse, reprogrammable, divertable, persistently divertable, raw XY, pos:0, group:2, group mask:g1,g2
             reporting: default
         3: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, persistently divertable, raw XY, pos:0, group:2, group mask:g1,g2
             reporting: default
         4: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, persistently divertable, raw XY, pos:0, group:2, group mask:g1,g2
             reporting: default
         5: Left Tilt                 , default: Mouse Scroll Left Button    => Mouse Scroll Left Button  
             mse, reprogrammable, divertable, persistently divertable, raw XY, pos:0, group:2, group mask:g1,g2
             reporting: default
         6: Right Tilt                , default: Mouse Scroll Right Button   => Mouse Scroll Right Button 
             mse, reprogrammable, divertable, persistently divertable, raw XY, pos:0, group:2, group mask:g1,g2
             reporting: default
         7: MultiPlatform Gesture Button, default: Multiplatform Gesture Button => Multiplatform Gesture Button
             mse, reprogrammable, divertable, persistently divertable, raw XY, pos:0, group:2, group mask:g1,g2
             reporting: default
         8: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, raw XY, force raw XY, pos:0, group:3, group mask:empty
             reporting: default
     Battery: 90%, discharging, next level 50%.

  2: K850 Performance Wireless Keyboard
     Device path  : /dev/hidraw2
     WPID         : 4062
     Codename     : K850
     Kind         : keyboard
     Protocol     : HID++ 4.5
     Polling rate : 20 ms (50Hz)
     Serial number: E2A15F0B
     Model ID:      B34D40620000
     Unit ID:       178D05AD
        Bootloader: BOT 43.01.B0004
          Firmware: MPK 04.03.B0015
             Other: 
     The power switch is located on the edge of top right corner.
     Supports 31 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Bootloader BOT 43.01.B0004 00002FD362F001
            Firmware: Firmware MPK 04.03.B0015 40622FD362F001
            Firmware: Other   
            Unit ID: 178D05AD  Model ID: B34D40620000  Transport IDs: {'btleid': 'B34D', 'wpid': '4062'}
         3: DEVICE NAME            {0005}   
            Name: K850 Performance Wireless Keyboard
            Kind: keyboard
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: DEVICE FRIENDLY NAME   {0007}   
            Friendly Name: Keyboard K850
         7: BATTERY STATUS         {1000}   
            Battery: 90%, discharging, next level 50%.
         8: CHANGE HOST            {1814}   
            Change Host        : 2:desktop
         9: HOSTS INFO             {1815}   
            Host 0 (paired): rpi
            Host 1 (paired): desktop
            Host 2 (paired): laptop
        10: REPROG CONTROLS V4     {1B04}   
            Key/Button Diversion (saved): {'1': 0, '10': 0, '189': 0, '191': 0, '192': 0, '193': 0, '194': 0, '2': 0, '209': 0, '210': 0, '211': 0, '212': 0, '213': 0, '214': 0, '221': 0, '3': 0, '4': 0, '5': 0, '6': 0}
            Key/Button Diversion        : {'209': 0, '210': 0, '211': 0, '213': 0, '214': 0, '189': 0, '212': 0, '6': 0, '4': 0, '5': 0, '3': 0, '2': 0, '1': 0, '194': 0, '221': 0, '191': 0, '10': 0, '193': 0, '192': 0}
        11: PERSISTENT REMAPPABLE ACTION {1C00}   
        12: K375S FN INVERSION     {40A3}   
            Swap Fx function (saved): False
            Swap Fx function        : False
        13: ENCRYPTION             {4100}   
        14: LOCK KEY STATE         {4220}   
        15: KEYBOARD DISABLE KEYS  {4521}   
            Disable keys (saved): {'1': False, '16': False, '2': False, '4': False, '8': False}
            Disable keys        : {'1': False, '2': False, '4': False, '8': False, '16': False}
        16: MULTIPLATFORM          {4531}   
            Set OS (saved): 0
            Set OS        : Windows
        17: DFUCONTROL SIGNED      {00C2}   
        18: unknown:1803           {1803}   internal, hidden
        19: CONFIG DEVICE PROPS    {1806}   internal, hidden
        20: OOBSTATE               {1805}   internal, hidden
        21: unknown:1813           {1813}   internal, hidden
        22: unknown:1830           {1830}   internal, hidden
        23: unknown:1861           {1861}   internal, hidden
        24: unknown:1890           {1890}   internal, hidden
        25: unknown:1891           {1891}   internal, hidden
        26: unknown:18A1           {18A1}   internal, hidden
        27: unknown:1DF3           {1DF3}   internal, hidden
        28: unknown:1E00           {1E00}   hidden
        29: unknown:1EB0           {1EB0}   internal, hidden
        30: unknown:18B0           {18B0}   internal, hidden
     Has 21 reprogrammable keys:
         0: Host Switch Channel 1     , default: HostSwitch Channel 1        => HostSwitch Channel 1      
             nonstandard, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
         1: Host Switch Channel 2     , default: HostSwitch Channel 2        => HostSwitch Channel 2      
             nonstandard, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
         2: Host Switch Channel 3     , default: HostSwitch Channel 3        => HostSwitch Channel 3      
             nonstandard, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
         3: MultiPlatform Home/Mission Control, default: Multiplatform Home/Mission Control => Multiplatform Home/Mission Control
             is FN, FN sensitive, reprogrammable, divertable, persistently divertable, pos:1, group:0, group mask:empty
             reporting: default
         4: MultiPlatform Menu/Show/Hide Virtual Keyboard/Launchpad, default: Multiplatform Menu/Launchpad => Multiplatform Menu/Launchpad
             is FN, FN sensitive, reprogrammable, divertable, persistently divertable, pos:2, group:0, group mask:empty
             reporting: default
         5: Multiplatform Back        , default: MultiPlatform Back          => MultiPlatform Back        
             is FN, FN sensitive, reprogrammable, divertable, persistently divertable, pos:3, group:0, group mask:empty
             reporting: default
         6: MultiPlatform Search      , default: Multiplatform Search        => Multiplatform Search      
             is FN, FN sensitive, reprogrammable, divertable, persistently divertable, pos:4, group:0, group mask:empty
             reporting: default
         7: Previous                  , default: Previous                    => Previous                  
             is FN, FN sensitive, divertable, persistently divertable, pos:5, group:0, group mask:empty
             reporting: default
         8: Play/Pause                , default: Play/Pause                  => Play/Pause                
             is FN, FN sensitive, divertable, persistently divertable, pos:6, group:0, group mask:empty
             reporting: default
         9: Next                      , default: Next                        => Next                      
             is FN, FN sensitive, divertable, persistently divertable, pos:7, group:0, group mask:empty
             reporting: default
        10: Mute                      , default: Mute                        => Mute                      
             is FN, FN sensitive, divertable, persistently divertable, pos:8, group:0, group mask:empty
             reporting: default
        11: Volume Down               , default: Volume Down                 => Volume Down               
             is FN, FN sensitive, divertable, persistently divertable, pos:9, group:0, group mask:empty
             reporting: default
        12: Volume Up                 , default: Volume Up                   => Volume Up                 
             is FN, FN sensitive, divertable, persistently divertable, pos:10, group:0, group mask:empty
             reporting: default
        13: Multiplatform Lock        , default: WindowsLock                 => WindowsLock               
             is FN, FN sensitive, reprogrammable, divertable, persistently divertable, pos:11, group:0, group mask:empty
             reporting: default
        14: Multi Platform Language Switch, default: Multiplatform Language Switch => Multiplatform Language Switch
             is FN, FN sensitive, reprogrammable, divertable, persistently divertable, pos:12, group:0, group mask:empty
             reporting: default
        15: Screen Capture/Print Screen, default: Screen Capture              => Screen Capture            
             is FN, reprogrammable, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
        16: Calculator                , default: Calculator                  => Calculator                
             is FN, reprogrammable, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
        17: Fn Up                     , default: unknown:0070                => unknown:0070              
             is FN, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
        18: Fn Down                   , default: unknown:006F                => unknown:006F              
             is FN, divertable, persistently divertable, pos:0, group:0, group mask:empty
             reporting: default
        19: F Lock                    , default: Do Nothing One              => Do Nothing One            
             is FN, pos:0, group:0, group mask:empty
             reporting: default
        20: unknown:0034              , default: Do Nothing One              => Do Nothing One            
             nonstandard, pos:0, group:0, group mask:empty
             reporting: default
     Battery: 90%, discharging, next level 50%.

Alter device configuration.

$ solaar config -h
usage: solaar config [-h] device [setting] [value_key] [extra_subkey] [extra2]

positional arguments:
  device        device to configure; may be a device number (1..6), a serial number, or a substring of a device's name
  setting       device-specific setting; leave empty to list available settings
  value_key     new value for the setting or key for keyed settings
  extra_subkey  value for keyed or subkey for subkeyed settings
  extra2        value for subkeyed settings

options:
  -h, --help    show this help message and exit

Please note that configuration only works on active devices.
$ solaar config 2 change-host 3
Setting change-host of K850 Performance Wireless Keyboard to 3:laptop

Unpair specific device.

$ solaar unpair -h
usage: solaar unpair [-h] device

positional arguments:
  device      device to unpair; may be a device number (1..6), a serial number, or a substring of a device's name.

options:
  -h, --help  show this help message and exit
$ solaar unpair "K850 Performance Wireless Keyboard"
Unpaired 2: K850 Performance Wireless Keyboard (K850) [4062:E2A15F0B]

Pair a now device.

$ solaar pair -h
usage: solaar pair [-h] [receiver]

positional arguments:
  receiver    select receiver by name substring or serial number when more than one is present

options:
  -h, --help  show this help message and exit

The Logitech Unifying Receiver supports up to 6 paired devices at the same time.
$ solaar pair
Pairing: turn your new device on (timing out in 30 seconds).
Paired device 2: K850 (K850) [4062:E2A15F0B]