internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pwr-Solaar/Solaar

Issue:
hide status bar icon when no device is connected
**Information**
<!-- Please update to Solaar from this repository before asking for a new feature. -->
- Solaar version (`solaar --version` and `git describe --tags`): 1.1.0
- Distribution: Fedora Linux 35
- Kernel version (ex. `uname -srmo`):  Linux 5.15.12-200.fc35.x86_64 x86_64 GNU/Linux

**Is your feature request related to a problem? Please describe.**
I use my MX Master and MX Keys on my laptop occasionally thus I have Solaar installed to show battery levels and configure some of the settings, but mostly they are not connected. I have a small screen and I'd like to have the option to hide the status icon if solaar has not detected any connected devices.

**Describe the solution you'd like**
If I connect a Solaar compatible device only then does solaar show its battery level, optionally for both devices with little keyboard and mouse icons next to the battery or in the dropdown, separated, so I know the battery levels exactly without opening the app




Discussion:
Having multiple little icons instead of one isn't going to work well.   What does work now is that the Solaar menu shows battery levels for devices in the tray menu, which shows up when the tray icon is clicked
Having the tray icon not be visible when there is no device to control sounds good in general.  If there is no device to control then there is little reason to open the Solaar main window.  If the main window needs to be opened when no devices are available this can be done by invoking Solaar, which will not start a second copy of Solaar.

Resolving patch:
diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py
--- a/lib/solaar/ui/tray.py
+++ b/lib/solaar/ui/tray.py
@@ -197,9 +197,12 @@ def _create(menu):
 
         return ind
 
-    def _destroy(indicator):
+    def _hide(indicator):
         indicator.set_status(AppIndicator3.IndicatorStatus.PASSIVE)
 
+    def _show(indicator):
+        indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
+
     def _update_tray_icon():
         if _picked_device and gtk.battery_icons_style != 'solaar':
             _ignore, _ignore, name, device_status = _picked_device
@@ -246,9 +249,12 @@ def _create(menu):
 
         return icon
 
-    def _destroy(icon):
+    def _hide(icon):
         icon.set_visible(False)
 
+    def _show(icon):
+        icon.set_visible(True)
+
     def _update_tray_icon():
         tooltip_lines = _generate_tooltip_lines()
         tooltip = '\n'.join(tooltip_lines).rstrip('\n')
@@ -463,13 +469,14 @@ def init(_quit_handler):
     _menu = _create_menu(_quit_handler)
     assert _icon is None
     _icon = _create(_menu)
+    update()
 
 
 def destroy():
     global _icon, _menu, _devices_info
     if _icon is not None:
         i, _icon = _icon, None
-        _destroy(i)
+        _hide(i)
         i = None
 
     _icon = None
@@ -525,3 +532,9 @@ def update(device=None):
         _picked_device = _pick_device_with_lowest_battery()
 
     _update_tray_icon()
+
+    if _icon:
+        if not _devices_info:
+            _hide(_icon)
+        else:
+            _show(_icon)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Add support for g733 lightspeed headphones
It would be great to support the g733 lightspeed headphones. I have a pair of these so can help gather any information required to display stuff such as battery life etc. Not sure where to start adding support myself though...



Discussion:
If these headphones use HID++ then it should be possible to support them.  

To start the process of support:

Look at output of `lsusb` to find ID of device or receiver.
Provide output of `lsusb -vv -d xxxx:yyyy` where xxxx:yyyy is ID of device or receiver.

Look at output of `grep -H . /sys/class/hidraw/hidraw*/device/uevent` to find directory for the device or receiver, e.g., `/sys/class/hidraw/hidraw3/device/uevent:HID_NAME=Logitech USB Receiver`.
Provide contents of the file `/sys/class/hidraw/hidrawN/device/report_descriptor` where N was found above.  You will have to copy the contents to a file with txt extension before attaching it.
Or, better, install hidrd-convert and provide output of `hidrd-convert -o spec /sys/class/hidraw/hidrawN/device/report_descriptor`.

PS:  What this provides is information about the interfaces that the device or receiver uses to help determine whether Solaar can effectively communicate with the device or receiver.

Here is an example of a report_descriptor

[report_descriptor.txt](https://github.com/pwr-Solaar/Solaar/files/7864687/report_descriptor.txt)

[lsusb.txt](https://github.com/pwr-Solaar/Solaar/files/7877519/lsusb.txt)

[report_descriptor.txt](https://github.com/pwr-Solaar/Solaar/files/7877540/report_descriptor.txt)


[hidrd.txt](https://github.com/pwr-Solaar/Solaar/files/7877544/hidrd.txt)


Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -463,4 +463,5 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 
 # Headset
 
+_D('Logitech G733 Gaming Headset', codename='G733 Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0ab5)
 _D('Logitech PRO X Wireless Gaming Headset', codename='PRO Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0aba)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Option monochrome indicator or autostart enable / disable
Hello and good day,

first and foremost thank you very much for this wonderful application.

As a GNOME Shell user I would like to see a monochrome indicator icon or alternatively an option to disable the autostart feature.

![grafik](https://user-images.githubusercontent.com/6410852/149958194-8d840366-7689-4ed8-b1bb-b8ba8a98a1f2.png)

Currently it's the only coloured icon in my bar and it really does not blend well. I would therefore either prefer a monochrome icon or an option to hide it.

Thank you for reading and all the best


Discussion:
The Solaar autostart is either something that you set up or that is set up by the package you used to install Solaar.   So Solaar autostarting is not something that is part of Solaar. 

A symbolic version of the Solaar icons might be useful.
Got it, might be the Fedora specific package then.

Thank you for the quick response!

Resolving patch:
diff --git a/lib/solaar/ui/icons.py b/lib/solaar/ui/icons.py
--- a/lib/solaar/ui/icons.py
+++ b/lib/solaar/ui/icons.py
@@ -91,6 +91,8 @@ def _init_icon_paths():
         _log.debug('icon theme paths: %s', _default_theme.get_search_path())
 
     if gtk.battery_icons_style == 'symbolic':
+        global TRAY_OKAY
+        TRAY_OKAY = TRAY_INIT  # use monochrome tray icon
         if not _default_theme.has_icon('battery-good-symbolic'):
             _log.warning('failed to detect symbolic icons')
             gtk.battery_icons_style = 'regular'


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Too high PyYAML and psutil version requirements for RHEL/CentOS 8 base OS
**Information**
<!-- Please update to Solaar from this repository before asking for a new feature. -->
- Solaar version (`solaar --version` and `git describe --tags`): **1.1.1**
- Distribution: **RHEL 8.5**
- Kernel version (ex. `uname -srmo`): `Linux 4.18.0-348.7.1.el8_5.x86_64 x86_64 GNU/Linux`
- Output of `solaar show` for the target device (if applicable): **N/A**

**Is your feature request related to a problem? Please describe.**
[setup.py](https://github.com/pwr-Solaar/Solaar/blob/master/setup.py#L63) lists requirements for PyYAML >= 5.1 and psutil >= 5.6.0. Unfortunately, RHEL8 and derivatives carry PyYAML 3.12 and psutil 5.4.3 built for the default python 3.6 in the base OS repository. Consequently, solaar is not installable without installing `python38` or `python39` stack (called module in RHEL/Fedora) that carry newer versions of these two. I've had a request from RHEL8 user to provide a package for RHEL8 in Fedora EPEL, hence this issue.

**Describe the solution you'd like**
If there's no specific reason for the higher versions, I'd like the requirements to be lowered to the versions listed above. I will provide a patch if agreed. I made a build for RHEL8 with these dependencies patched to lower versions and a user tested it and confirmed it seems to be working fine for him.

**Describe alternatives you've considered**
Regular packages in Fedora/EPEL may not depend on modular packages, only base OS. I considered maintaining solaar as a modular package, but this seems very complicated and I don't really have time for this. On the other hand, building it as a regular package adds minimal overhead to my Fedora package maintenance.


Discussion:
By the way, the PyYAML and psutil dependencies were introduced in 0427e5607e483bf9ef9f46a51c40129401cdb994 and then the psutil requirement was lowered to 5.6.0 in 7d0402a97f349c5285103f715af26c36fb1f8ef7 without mentioning a specific reason.
Some dependencies simply come from what was current in Fedora at the time.  If the versions of the dependent packages can be reduced without problem, then let's try to do so.

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


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
error in SpeedChange setting template
- Solaar version (`solaar --version` or `git describe --tags` if cloned from this repository):  current 
- Distribution: Fedora

**Describe the bug**
A clear and concise description of what the bug is.

Error in check_feature for feature speed-change

```
     INFO [ReceiverListener:hidraw2] logitech_receiver.settings_templates: check_feature dpi-sliding [REPROG CONTROLS V4] detected None
    ERROR [ReceiverListener:hidraw2] logitech_receiver.settings_templates: check_feature speed-change [POINTER SPEED] error Traceback (most recent call last):
e/[user]/src/Solaar/lib/logitech_receiver/settings_templates.py", line 1116, in check_feature
 = sclass.build(device)
e/[user]/src/Solaar/lib/logitech_receiver/settings.py", line 222, in build
class(cls.feature if cls.feature else cls.register, **cls.rw_options)
eatureRW.__init__() got an unexpected keyword argument 'name'
```


Discussion:

Resolving patch:
diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py
--- a/lib/logitech_receiver/settings_templates.py
+++ b/lib/logitech_receiver/settings_templates.py
@@ -546,7 +546,7 @@ class SpeedChange(_Setting):
     feature = _F.POINTER_SPEED
     rw_options = {'name': 'speed change'}
 
-    class _SpeedChangeRW(_ActionSettingRW):
+    class rw_class(_ActionSettingRW):
         def press_action(self):  # switch sensitivity
             currentSpeed = self.device.persister.get('pointer_speed', None) if self.device.persister else None
             newSpeed = self.device.persister.get('_speed-change', None) if self.device.persister else None


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Allow scrolling over tray icon to switch between icons when there are fewer than 4 devices
**Information**
<!-- Please update to Solaar from this repository before asking for a new feature. -->
- Solaar version (`solaar --version` and `git describe --tags`): solaar 1.1.1, 1.1.1-135-gd115ade



**Is your feature request related to a problem? Please describe.**
It would be useful for me to be able to switch between which device the tray icon shows, even though I have only two devices.
[This commit](https://github.com/pwr-Solaar/Solaar/commit/6a66370ffe54a6b08f6f4b0e6fc76b0da2a23d30) has introduced such an ability, but for some reason it doesn't enable it for people with fewer than 4 devices.
Specifically, this is the block that does the check and where I think `4` should be replaced with `2` (or `3` if the receiver itself is in that list as well, although ideally those should probably be filtered out before the check):
https://github.com/pwr-Solaar/Solaar/blob/1ace3ef4f4cc90520d5607fde073e6cd1b66d56a/lib/solaar/ui/tray.py#L87-L90



Discussion:

Resolving patch:
diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py
--- a/lib/solaar/ui/tray.py
+++ b/lib/solaar/ui/tray.py
@@ -84,9 +84,7 @@ def _scroll(tray_icon, event, direction=None):
         # ignore all other directions
         return
 
-    if len(_devices_info) < 4:
-        # don't bother with scrolling when there's only one receiver
-        # with only one or two devices
+    if sum(map(lambda i: i[1] is not None, _devices_info)) < 2:  # don't bother even trying to scroll if less than two devices
         return
 
     # scroll events come way too fast (at least 5-6 at once)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Percentage in System-Tray Info
**Information**
- Distribution: Arch Linux, KDE (X11 and/or Wayland)
- Solaar: 1.1.3

Just something simple. 

Where you click the icon of Solaar and it gives you a little info of what device, it has the picture of the percentage of battery life, but could we also have maybe the actual i.e ( 80%) next to the icon?

![Screenshot_20220517_151734](https://user-images.githubusercontent.com/30347697/168912748-9786f7cb-94fb-414c-9a99-0ea905f8ab2d.jpeg)




Discussion:
The easiest would be to make it look the same as the information that you see when you hover over the tray icon, i.e., `<device name>: Battery: ...`

Oh yeah, a hover feature like that would be great. Right now just shows the app name. 
Solaar tries to set up the hover feature, but I think some tray implementations don't have it.  In fact, I seem to remember a thread where some window manager implementers said, in essence, "Over our dead bodies".  In XFCE information about the device with the lowest battery level is displayed along with its battery level.
Hmm  I see. I just switched from MX-Linux to Arch Linux a few days ago, and in MX-Linux I was using XFCE, and I did see the hover being one item out of the two that I have, such as the lowest. But I really enjoy KDE now. Hopefully it wasn't the KDE folks who said such a statement. Could be GNOME? Idk haha. Anyway. Hopefully you will be able to in KDE.

Resolving patch:
diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py
--- a/lib/solaar/ui/tray.py
+++ b/lib/solaar/ui/tray.py
@@ -440,6 +440,7 @@ def _update_menu_item(index, device):
     charging = device.status.get(_K.BATTERY_CHARGING)
     icon_name = _icons.battery(level, charging)
 
+    menu_item.set_label(('  ' if 0 < device.number <= 6 else '') + device.name + ': ' + device.status.to_string())
     image_widget = menu_item.get_image()
     image_widget.set_sensitive(bool(device.online))
     _update_menu_icon(image_widget, icon_name)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Add G935 headset support.
**Information**
<!-- Please update to Solaar from this repository before asking for a new feature. -->
- Solaar version : solaar 1.1.4
- Distribution: Ubuntu
- Kernel version (ex. `uname -srmo`): Linux 5.15.0-43-generic x86_64 GNU/Linux
- Output of `solaar show` for the target device (if applicable): none

**Describe the solution you'd like**
As I own a G935 headset, I would love to see them supported here.
I followed your 'guide' from [here](https://github.com/pwr-Solaar/Solaar/issues/1419) and managed to pull `/sys/class/hidraw/hidraw3/device/report_descriptor` file.

I'm currently rocking Ubuntu 22.04 and I'm unable to use `hidrd-convert` to convert it so I'm leaving a file here.
Please let me know if you need any other information.

[report_descriptor.txt](https://github.com/pwr-Solaar/Solaar/files/9301498/report_descriptor.txt)
[935lsusb.txt](https://github.com/pwr-Solaar/Solaar/files/9301513/935lsusb.txt)



Discussion:

Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -309,6 +309,7 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 
 # Headset
 
-_D('Logitech G533 Gaming Headset', codename='G533 Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0a66)
-_D('Logitech G733 Gaming Headset', codename='G733 Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0ab5)
-_D('Logitech PRO X Wireless Gaming Headset', codename='PRO Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0aba)
+_D('G533 Gaming Headset', codename='G533 Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0a66)
+_D('G935 Gaming Headset', codename='G935 Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0a87)
+_D('G733 Gaming Headset', codename='G733 Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0ab5)
+_D('PRO X Wireless Gaming Headset', codename='PRO Headset', protocol=2.0, interface=3, kind=_DK.headset, usbid=0x0aba)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Solaar does not see my devices. Mice (G600) and what about keyboard prodigy logitech is it supported?
Hi. I ve installed solaar. Does not see my devices. Recently i loaded needed kernel modules. What im supossed to do or check? Send me to the topic if you are kind enough or let me know the commands or whatever i should do as a next step. Thank you. Greetings. Gregory.

Bug report: Linux- RHEL 9


Discussion:

Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -204,6 +204,7 @@ def get_btid(btid):
 _D('Wireless Illuminated Keyboard K800 new', codename='K800 new', protocol=4.5, wpid='406E', settings=[_ST.FnSwap])
 _D('MX Keys Keyboard', codename='MX Keys', protocol=4.5, wpid='408A', btid=0xB35B)
 _D('G915 TKL LIGHTSPEED Wireless RGB Mechanical Gaming Keyboard', codename='G915 TKL', protocol=4.2, wpid='408E', usbid=0xC343)
+_D('G213 Prodigy Gaming Keyboard', codename='G213', usbid=0xc336, interface=1)
 _D('G512 RGB Mechanical Gaming Keyboard', codename='G512', usbid=0xc33c, interface=1)
 _D('G815 Mechanical Keyboard', codename='G815', usbid=0xc33f, interface=1)
 
@@ -296,6 +297,7 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 _D('G903 Hero Gaming Mouse', codename='G903 Hero', usbid=0xc091)
 _D('G102 Lightsync Mouse', codename='G102', usbid=0xc092, interface=1)
 _D('M500S Mouse', codename='M500S', usbid=0xc093, interface=1)
+# _D('G600 Gaming Mouse', codename='G600 Gaming', usbid=0xc24a, interface=1) # not an HID++ device
 _D('G502 Proteus Spectrum Optical Mouse', codename='G502 Proteus Spectrum', usbid=0xc332, interface=1)
 
 # Trackballs


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Claim about secure unencrypted mouse
**Information**

There is a message in solaar

```text
The wireless link between this device and its receiver is not encrypted.

For pointing devices (mice, trackballs, trackpads), this is a minor security issue.

It is, however, a major security issue for text-input devices (keyboards, numpads),
because typed text can be sniffed inconspicuously by 3rd parties within range.
```

The claim that this is a minor security issue is quite frankly false. Depending on the exposure and the threat level this can be a big gaping security hole.

I propose to replace the text with something like

```text
The wireless link between this device and its receiver is not encrypted.

it is a security issue for pointing devices, but it is a major security issue for text-input devices. Typed text (like passwords) can be sniffed inconspicuously by 3rd parties within range.
```

The new text simply inform that this is a security issue for pointing devices, and that it is a serious issue for text input devices. In particular it does not give the impression that unencrypted pointing devices doesn't have any real problems.



Discussion:
I think that text was derived from some other material and, as you say, isn't correct.

Resolving patch:
diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py
--- a/lib/solaar/ui/window.py
+++ b/lib/solaar/ui/window.py
@@ -730,11 +730,7 @@ def _update_device_panel(device, panel, buttons, full=False):
             panel._secure.set_tooltip_text(
                 _(
                     'The wireless link between this device and its receiver is not encrypted.\n'
-                    '\n'
-                    'For pointing devices (mice, trackballs, trackpads), this is a minor security issue.\n'
-                    '\n'
-                    'It is, however, a major security issue for text-input devices (keyboards, numpads),\n'
-                    'because typed text can be sniffed inconspicuously by 3rd parties within range.'
+                    'This is a security issue for pointing devices, and a major security issue for text-input devices.'
                 )
             )
         else:


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
eliminate visual glitching when updating a setting
**Information**

- Solaar version (`solaar --version` and `git describe --tags`): 1.1.6



**Is your feature request related to a problem? Please describe.**

Some setting displays glitch when updated, maybe only range settings.  For a very short time, a spinner is displayed and the size of the setting control is reduced.

**Describe the solution you'd like**

The size of the setting control should not change.




Discussion:

Resolving patch:
diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py
--- a/lib/solaar/ui/config_panel.py
+++ b/lib/solaar/ui/config_panel.py
@@ -593,7 +593,7 @@ def _create_sbox(s, device):
 
 
 def _update_setting_item(sbox, value, is_online=True, sensitive=True):
-    sbox._spinner.set_visible(False)
+    #    sbox._spinner.set_visible(False)   # don't repack item box
     sbox._spinner.stop()
     if value is None:
         sbox._control.set_sensitive(False)


Test patch:
Repository: pwr-Solaar/Solaar

Issue:
Release 1.1.7



Discussion:
Why is typing_extensions a dependency now? I don't see it used anywhere in the code.
It's used by hid-parser.  

It may be that Solaar shouldn't have the dependency and count on hid-parser depending on it, or maybe put it in the report-descriptor option,  but I seem to remember having a problem at one time when it wasn't included.   I'll investigate.
Aaah, typing_extensions is only needed in Python 3.7 for hid-parser.
If you have Python 3.8 or later it is not needed.

A better line there would be
        'typing_extensions (>=4.0.0) ; python_version<"3.8"',
which will be added soon.  

`hid_parser` already has the dependency, so I think this project should not depend on something it itself doesn't use.
https://github.com/usb-tools/python-hid-parser/blob/4b7944f4999e152c678cd7fa76278b7e2535c3ff/setup.cfg#L21
```
install_requires =
    typing-extensions; python_version < '3.8'
```

This was added in https://github.com/usb-tools/python-hid-parser/commit/e0dfe5901a2693beb41149b595a8e72f2dcc6c84 which happened before the first release of `hid_parser`, so there should be no way a user could end up with hid_parser installed, but not typing-extensions and with Python 3.7.
I somehow missed that.  Now I'm wondering how I ever got an error on that package.

So out it goes.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -66,7 +66,6 @@ def _data_files():
         'PyYAML (>= 3.12)',
         'python-xlib (>= 0.27)',
         'psutil (>= 5.4.3)',
-        'typing_extensions (>=4.0.0)',
     ],
     extras_require={
         'report-descriptor': ['hid-parser'],


Test patch: