Repository: pwr-Solaar/Solaar

Issue:
In Linux Mint 20, Solaar suddenly won't start
I have installed Solaar on my Linux Mint 20 O/S and was working fine till this morning when Solaar suddenly will not start.  Have no idea why.

- Solaar version: solaar 1.0.4
- Distribution: Linux Mint 20 XFCE
- Kernel version (ex. `uname -srmo`): `Linux 5.4.0-53-generic x86_64 GNU/Linux`
- Output of `solaar show`:
(solaar:28696): dbind-WARNING **: 22:33:44.353: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Unifying Receiver
  Device path  : /dev/hidraw1
  USB id       : 046d:C52B
  Serial       : 43799195
    Firmware   : 12.11.B0032
    Bootloader : 04.16
    Other      : AA.AA
  Has 1 paired device(s) out of a maximum of 6.
  Notifications: wireless, software present (0x000900)
  Device activity counters: 2=128

  2: ERGO M575 Trackball
     Device path  : /dev/hidraw6
     WPID         : 4096
     Codename     : ERGO M575
     Kind         : mouse
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: 0EB362BF
     Model ID:      B02740960000
     Unit ID:       0EB362BF
        Bootloader: BOT 40.00.B0009
          Firmware: MPM 26.00.B0009
             Other: 
     The power switch is located on the base.
     Supports 26 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Bootloader BOT 40.00.B0009 0000ABF1CB8B01
            Firmware: Firmware MPM 26.00.B0009 4096ABF1CB8B01
            Firmware: Other   
            Unit ID: 0EB362BF  Model ID: B02740960000  Transport IDs: {'btleid': 'B027', 'wpid': '4096'}
         3: DEVICE NAME            {0005}   
            Name: ERGO M575 Trackball
            Kind: trackball
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: DEVICE FRIENDLY NAME   {0007}   
         7: UNIFIED BATTERY        {1004}   
         8: REPROG CONTROLS V4     {1B04}   
            Key/Button Actions: {'80': 80, '81': 81, '82': 82, '86': 86, '83': 83}
            Key/Button Diversion: {'82': 0, '86': 0, '83': 0, '215': 0}
         9: ADJUSTABLE DPI         {2201}   
            Sensitivity (DPI): 400
        10: unknown:2250           {2250}   
        11: DFUCONTROL SIGNED      {00C2}   
        12: DEVICE RESET           {1802}   internal, hidden
        13: unknown:1803           {1803}   internal, hidden
        14: CONFIG DEVICE PROPS    {1806}   internal, hidden
        15: unknown:1812           {1812}   internal, hidden
        16: OOBSTATE               {1805}   internal, hidden
        17: unknown:1830           {1830}   internal, hidden
        18: unknown:1890           {1890}   internal, hidden
        19: unknown:1891           {1891}   internal, hidden
        20: unknown:18A1           {18A1}   internal, hidden
        21: unknown:1E00           {1E00}   hidden
        22: unknown:1EB0           {1EB0}   internal, hidden
        23: unknown:1861           {1861}   internal, hidden
        24: unknown:1E22           {1E22}   internal, hidden
        25: unknown:1F03           {1F03}   internal, hidden
     Has 6 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Click                
             mse, reprogrammable, analytics key events, pos:0, group:1, group mask:g1
             reporting: default
         1: Right Button              , default: Right Click                 => Right Click               
             mse, reprogrammable, analytics key events, 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, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         3: Forward Button            , default: Mouse Forward Button        => Mouse Forward Button      
             mse, reprogrammable, divertable, persistently divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         4: Back Button               , default: Mouse Back Button           => Mouse Back Button         
             mse, reprogrammable, divertable, persistently divertable, raw XY, analytics key events, pos:0, group:2, group mask:g1,g2
             reporting: default
         5: 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: 100%, discharging.

Nano Receiver
  Device path  : /dev/hidraw3
  USB id       : 046d:C534
  Serial       : None
    Firmware   : 29.01.B0016
  Has 2 paired device(s) out of a maximum of 2.
  Has 18 successful pairing(s) remaining.
  Notifications: wireless, software present (0x000900)

  1: Wireless Keyboard MK270
     Device path  : /dev/hidraw4
     WPID         : 4023
     Codename     : MK270
     Kind         : keyboard
     Protocol     : HID++ 2.0
     Polling rate : 20 ms (50Hz)
     Serial number: 00000000
     Model ID:      000000000000
     Unit ID:       00000000
          Firmware: RQK 49.00.B0029
     Supports 18 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
            Firmware: Firmware RQK 49.00.B0029 4023
            Unit ID: 00000000  Model ID: 000000000000  Transport IDs: {}
         3: DEVICE NAME            {0005}   
            Name: Wireless Keyboard  
            Kind: keyboard
         4: BATTERY STATUS         {1000}   
            Battery: 30%, discharging, next level 5%.
         5: REPROG CONTROLS        {1B00}   
         6: WIRELESS DEVICE STATUS {1D4B}   
         7: FN INVERSION           {40A0}   
            Swap Fx function: False
         8: ENCRYPTION             {4100}   
         9: KEYBOARD LAYOUT        {4520}   
        10: unknown:1810           {1810}   internal, hidden
        11: unknown:1830           {1830}   internal, hidden
        12: unknown:1890           {1890}   internal, hidden
        13: unknown:18A0           {18A0}   internal, hidden
        14: unknown:18B0           {18B0}   internal, hidden
        15: unknown:1DF3           {1DF3}   internal, hidden
        16: unknown:1E00           {1E00}   hidden
        17: unknown:1868           {1868}   internal, hidden
     Has 11 reprogrammable keys:
         0: My Home                    => HomePage                      is FN, FN sensitive, reprogrammable
         1: Mail                       => Email                         is FN, FN sensitive, reprogrammable
         2: Search                     => Search                        is FN, FN sensitive, reprogrammable
         3: Calculator                 => Calculator                    is FN, FN sensitive, reprogrammable
         4: Media Player               => Music                         is FN, FN sensitive, reprogrammable
         5: Previous                   => Previous                      is FN, FN sensitive
         6: Play/Pause                 => Play/Pause                    is FN, FN sensitive
         7: Next                       => Next                          is FN, FN sensitive
         8: Mute                       => Mute                          is FN, FN sensitive
         9: Volume Down                => Volume Down                   is FN, FN sensitive
        10: Volume Up                  => Volume Up                     is FN, FN sensitive
     Battery: 30%, discharging, next level 5%.

  2: Wireless Mouse M185 new
     Device path  : /dev/hidraw5
     WPID         : 4054
     Codename     : M185n
     Kind         : mouse
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: 00000000
     The power switch is located on the base.
     Battery: unknown (device is offline).

```

**Describe the bug**
Solaar will Not show icon on task bar and if I run it in terminal I get this:
(solaar:28445): dbind-WARNING **: 22:30:07.881: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Solaar depends on a udev file that is not present
For more information see the Solaar installation directions
at https://pwr-solaar.github.io/Solaar/installation
solaar: error: Traceback (most recent call last):
  File "/usr/share/solaar/lib/solaar/gtk.py", line 153, in main
    import solaar.listener as listener
  File "/usr/share/solaar/lib/solaar/listener.py", line 32, in <module>
    from logitech_receiver import notifications as _notifications
  File "/usr/share/solaar/lib/logitech_receiver/notifications.py", line 30, in <module>
    from . import diversion as _diversion
  File "/usr/share/solaar/lib/logitech_receiver/diversion.py", line 30, in <module>
    from pynput import keyboard as _keyboard
ModuleNotFoundError: No module named 'pynput'

**To Reproduce**
Steps to reproduce the behavior:
1. Go to 'terminal (or try to start Solaar)'
2. Type solaar in terminal
3. See above error.



**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
I have NO Idea why Solaar stopped showing the Panel Icon, or opening the GUI in terminal/icon mode.  Unless some other update has messed with it.  I even removed it completely in Synaptic and re-Installed it.

Never done this before, so I hope this helps.


Discussion:
It looks as if you have installed the version from this repository.  A recent enhancement to Solaar (rule processing of notifications) added a requirement on pynput and this requirement was not documented.  
The patch for now is to do
```
pip install --user pynput
```
Solaar will be updated soon to either document this new dependency or enforce it.

You appear to have something wrong with your dbind setup - hence the warning when you start Solaar - this does not appear to be affecting Solaar and, in any case, is not a Solaar problem, but you probably should try to do something so that dbind does not complain.
Hopefully there is only one missing dependency but if still can't start Solaar it probably is another missing dependency.
There are two other dependencies that might be needed  python-xlib and PyYAML.   They both can be installed using pip as above.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -60,6 +60,10 @@ def _data_files():
     python_requires='>=3.6',
     install_requires=[
         'pyudev (>= 0.13)',
+        'PyYAML (>= 5.1)',
+        'python-xlib (>= 0.27)',
+        'pynput (>= 1.7.0)',
+        'psutil (>= 5.7.3)',
     ],
     package_dir={'': 'lib'},
     packages=['hidapi', 'logitech_receiver', 'solaar', 'solaar.ui', 'solaar.cli'],


Test patch: