Merge branch 'master' into fix_2827
This commit is contained in:
commit
062402c7e0
|
|
@ -8,12 +8,20 @@ assignees: ''
|
|||
---
|
||||
|
||||
**Information**
|
||||
<!-- Make sure that your issue is not one of the known issues in the Solaar documentation at https://pwr-solaar.github.io/Solaar/ -->
|
||||
<!-- Do not bother opening an issue for a version older than 1.1.8. Upgrade to the latest version and see if your issue persists. -->
|
||||
<!-- If you are not running the current version of Solaar, strongly consider upgrading to the newest version. -->
|
||||
<!-- Make sure that your issue is not one of the known issues in the
|
||||
Solaar documentation at https://pwr-solaar.github.io/Solaar/ -->
|
||||
<!-- Make sure that Solaar's udev rule is running by executing
|
||||
`ls -l /dev/hidraw*` and looking for + as the last character of the permissions. -->
|
||||
<!-- Do not bother opening an issue for a version older than 1.1.14.
|
||||
Upgrade to the current version and see if your issue persists. -->
|
||||
<!-- If you are not running the current version of Solaar,
|
||||
strongly consider upgrading to the current version. -->
|
||||
<!-- Note that some distributions have very old versions of Solaar
|
||||
as their default version. -->
|
||||
|
||||
- Solaar version (`solaar --version` or `git describe --tags` if cloned from this repository):
|
||||
- Distribution:
|
||||
- Kernel version (ex. `uname -srmo`): `KERNEL VERSION HERE`
|
||||
- Kernel version (ex. `uname -srmo`):
|
||||
- Output of `solaar show`:
|
||||
|
||||
<details>
|
||||
|
|
@ -34,11 +42,11 @@ CONTENTS HERE
|
|||
|
||||
|
||||
- Errors or warrnings from Solaar:
|
||||
<!-- Under normal operation Solaar keeps a log of warning and error messages in ~/.tmp
|
||||
while it is running as a file starting with 'Solaar'.
|
||||
<!-- Under normal operation Solaar keeps a log of warning and error messages
|
||||
in ~/.tmp while it is running, as a file starting with 'Solaar'.
|
||||
If this file is not available or does not have useful information you can
|
||||
run Solaar as `solaar -dd`, after killing any running Solaar processes to
|
||||
have Solaar log informational, warning, and error messages to stdout. -->
|
||||
run Solaar as `solaar -ddd`, after killing any running Solaar processes to
|
||||
have Solaar log debug, informational, warning, and error messages to stdout. -->
|
||||
|
||||
|
||||
**Describe the bug**
|
||||
|
|
|
|||
80
CHANGELOG.md
80
CHANGELOG.md
|
|
@ -1,3 +1,83 @@
|
|||
# 1.1.16
|
||||
|
||||
* Add new flags for reprogrammable keys feature
|
||||
* Correctly handle missing battery feature
|
||||
|
||||
# 1.1.15
|
||||
|
||||
* Correctly re-raise permissions exception
|
||||
* Add several new special keys and tasks
|
||||
* Update several translations
|
||||
* Center labels and remove buggy entry resizing logic
|
||||
* Add shape keys from Key POP Icon
|
||||
* Device and Action rule conditions match on codename and name
|
||||
* Fix listing hidpp10 devices - bytes vs string concatenation (#2856)
|
||||
* Add present flag, unset when internal error occurs, set when notification appears
|
||||
* Pause setting up features when error occurs; use ADC message to signal connection and disconnection
|
||||
* Fix listing of hidpp10 peripherals
|
||||
* Complete DEVICE_FEATURES to DeviceFeature transition for hidpp10 devices
|
||||
* Fix NOTIFICATION_FLAG to NotificationFlag transition leftovers
|
||||
* Fix github workflow stopping all matrix jobs when one of them fails
|
||||
* Fix ubuntu github CI
|
||||
* Update index.md
|
||||
* Python documentation appears to be broken so don't set it up
|
||||
* Improve documentation on onboard profiles
|
||||
* Use correct LOD values for extended adjustable dpi
|
||||
* Better support RGB Effects - not readable
|
||||
* Fix crash when asking for help about config
|
||||
* Fix error when updating ChoiceControlBig box
|
||||
* Add uninstallation docs
|
||||
* Handle unknown power switch locations again
|
||||
* Correctly handle selection of [empty] in rule editor
|
||||
* Handle `HIDError` in `hidapi.hidapi_impl._match()` (#2804)
|
||||
* Give ghost devices a path
|
||||
* Guard against typeerror when setting the value of a control box
|
||||
* Recover from errors in ping
|
||||
* Replace spaces by underscores when looking up features
|
||||
* Rewrote string concatenation/format with f strings
|
||||
* Fix logo not showing in about dialog box
|
||||
* Make typing-extensions dependency mandatory
|
||||
* Properly ignore unsupported locale
|
||||
* hidapi: skip unsupported devices and handle exception on open
|
||||
* Ignore macOS junk files and pipenv config
|
||||
* Fix ui desktop notifications test
|
||||
* hidpp20: Remove dependency to NamedInts
|
||||
* Estimate accurate battery level for some rechargable devices (#2745)
|
||||
* Upgrade desktop notifications tests to take notifications availability into account
|
||||
* Update tests to run on Python 3.13
|
||||
* Remove outdated logger enabled checks
|
||||
* Introduce GTK signal types
|
||||
* Introduce error types
|
||||
* Remove alias for SupportedFeature
|
||||
* Refactor process_device_notification
|
||||
* Refactor process_receiver_notification
|
||||
* Refactor receiver event handling
|
||||
* Introduce custom logger
|
||||
* Refactor notifications
|
||||
* Rename variable to full name notification
|
||||
* Test notifications
|
||||
* Test extraction of serial and max. devices
|
||||
* Refactor extraction of serial and max. devices
|
||||
* macOS: Fix int.from_bytes, int.to_bytes for show.py
|
||||
* macOS: Remove udev rule warning
|
||||
* macOS: Add support for Bluetooth devices
|
||||
* Add back and forward mouseclick actions
|
||||
* Speedup lookup of known receivers
|
||||
* Refactor device filtering
|
||||
* Reorder private functions and variable definitions
|
||||
* Turn filter_products_of_interest into a public function
|
||||
* Improve tests of known receivers
|
||||
* Refactor: Remove NamedInts and move enums where used
|
||||
* Add docstrings and type hints
|
||||
* Enforce rules on RuleComponentUI subclasses
|
||||
* Simplify settings UI class
|
||||
* Remove diversion alias
|
||||
* Refactor: Convert Kind to IntEnum
|
||||
* Split up huge settings module
|
||||
* Remove Python 2 specific path handling
|
||||
* Delete logging temp file on exit
|
||||
* Update Swedish translation
|
||||
|
||||
# 1.1.14
|
||||
|
||||
* Handle fake feature enums in show
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ that are otherwise ignored by the Linux input system.
|
|||
<a href="https://pwr-solaar.github.io/Solaar/usage">Usage</a> -
|
||||
<a href="https://pwr-solaar.github.io/Solaar/capabilities">Capabilities</a> -
|
||||
<a href="https://pwr-solaar.github.io/Solaar/rules">Rules</a> -
|
||||
<a href="https://pwr-solaar.github.io/Solaar/installation">Manual Installation</a>
|
||||
<a href="https://pwr-solaar.github.io/Solaar/installation">Manual Installation</a> -
|
||||
<a href="https://pwr-solaar.github.io/Solaar/issues">Known Issues</a>
|
||||
|
||||
|
||||
[](https://codecov.io/gh/pwr-Solaar/Solaar)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
# Notes on Major Changes in Releases
|
||||
|
||||
## Version 1.1.16
|
||||
|
||||
* Two bugs that were affecting users in 1.1.15 are fixed.
|
||||
|
||||
## Version 1.1.15
|
||||
|
||||
* Some key names have been changed to match Logitech names. Rules that use removed names will no longer work and will end up with a key of 0.
|
||||
* Device and Action rule conditions match on device codename and name
|
||||
* Solaar supports configuration of Bluetooth devices on macOS.
|
||||
|
||||
## Version 1.1.13
|
||||
|
|
|
|||
|
|
@ -0,0 +1,132 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the program's name and an idea of what it does.
|
||||
Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
|
||||
type `show w'. This is free software, and you are welcome
|
||||
to redistribute it under certain conditions; type `show c'
|
||||
for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright
|
||||
interest in the program `Gnomovision'
|
||||
(which makes passes at compilers) written
|
||||
by James Hacker.
|
||||
|
||||
signature of Moe Ghoul, 1 April 1989
|
||||
Moe Ghoul, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
|
||||
Binary file not shown.
|
|
@ -1,59 +1,62 @@
|
|||
Solaar version 1.1.3
|
||||
Solaar version 1.1.14
|
||||
|
||||
1: PRO X Wireless
|
||||
2: PRO X Wireless
|
||||
Device path : None
|
||||
WPID : 4093
|
||||
Codename : PRO X
|
||||
Kind : mouse
|
||||
Protocol : HID++ 4.2
|
||||
Polling rate : 8 ms (125Hz)
|
||||
Serial number: 42F42E12
|
||||
Report Rate : 1ms
|
||||
Serial number: 8B24D1D1
|
||||
Model ID: 4093C0940000
|
||||
Unit ID: 42F42E12
|
||||
Bootloader: BL1 25.00.B0013
|
||||
Other:
|
||||
Firmware: MPM 25.01.B0018
|
||||
Unit ID: 8B24D1D1
|
||||
1: BL1 25.01.B0018
|
||||
3:
|
||||
0: MPM 25.01.B0018
|
||||
Supports 28 HID++ 2.0 features:
|
||||
0: ROOT {0000}
|
||||
1: FEATURE SET {0001}
|
||||
2: DEVICE FW VERSION {0003}
|
||||
Firmware: Bootloader BL1 25.00.B0013 AB00BE657A82
|
||||
Firmware: Other
|
||||
Firmware: Firmware MPM 25.01.B0018 4093FE92436C
|
||||
Unit ID: 42F42E12 Model ID: 4093C0940000 Transport IDs: {'wpid': '4093', 'usbid': 'C094'}
|
||||
3: DEVICE NAME {0005}
|
||||
0: ROOT {0000} V0
|
||||
1: FEATURE SET {0001} V0
|
||||
2: DEVICE FW VERSION {0003} V3
|
||||
Firmware: 1 BL1 25.01.B0018 AB00FE92436C
|
||||
Firmware: 3
|
||||
Firmware: 0 MPM 25.01.B0018 4093FE92436C
|
||||
Unit ID: 8B24D1D1 Model ID: 4093C0940000 Transport IDs: {'wpid': '4093', 'usbid': 'C094'}
|
||||
3: DEVICE NAME {0005} V0
|
||||
Name: PRO X Wireless
|
||||
Kind: mouse
|
||||
4: WIRELESS DEVICE STATUS {1D4B}
|
||||
5: RESET {0020}
|
||||
6: UNIFIED BATTERY {1004}
|
||||
7: COLOR LED EFFECTS {8070} internal, hidden
|
||||
8: ONBOARD PROFILES {8100}
|
||||
Device Mode: Host
|
||||
Onboard Profiles (saved): Disable
|
||||
Onboard Profiles : Disable
|
||||
9: MOUSE BUTTON SPY {8110}
|
||||
10: REPORT RATE {8060}
|
||||
Polling Rate (ms): 1
|
||||
Polling Rate (ms) (saved): 1
|
||||
Polling Rate (ms) : 1
|
||||
11: ADJUSTABLE DPI {2201}
|
||||
Sensitivity (DPI) (saved): 1000
|
||||
Sensitivity (DPI) : 1000
|
||||
12: unknown:1500 {1500}
|
||||
13: DEVICE RESET {1802} internal, hidden
|
||||
14: unknown:1803 {1803} internal, hidden
|
||||
15: CONFIG DEVICE PROPS {1806} internal, hidden
|
||||
16: unknown:1811 {1811} internal, hidden
|
||||
17: OOBSTATE {1805} internal, hidden
|
||||
18: unknown:1830 {1830} internal, hidden
|
||||
19: unknown:1890 {1890} internal, hidden
|
||||
20: unknown:1891 {1891} internal, hidden
|
||||
21: unknown:18A1 {18A1} internal, hidden
|
||||
22: unknown:1801 {1801} internal, hidden
|
||||
23: unknown:18B1 {18B1} internal, hidden
|
||||
24: unknown:1E00 {1E00} hidden
|
||||
25: unknown:1EB0 {1EB0} internal, hidden
|
||||
26: unknown:1863 {1863} internal, hidden
|
||||
27: unknown:1E22 {1E22} internal, hidden
|
||||
Battery: 76%, discharging.
|
||||
4: WIRELESS DEVICE STATUS {1D4B} V0
|
||||
5: CONFIG CHANGE {0020} V0
|
||||
Configuration: 11000000000000000000000000000000
|
||||
6: UNIFIED BATTERY {1004} V1
|
||||
Battery: 71%, 0.
|
||||
7: COLOR LED EFFECTS {8070} V4 internal, hidden
|
||||
LED Control : HID++ error {'number': 2, 'request': 1908, 'error': 5, 'params': b''}
|
||||
8: ONBOARD PROFILES {8100} V0
|
||||
Device Mode: On-Board
|
||||
Onboard Profiles (saved): Profile 1
|
||||
Onboard Profiles : Profile 1
|
||||
9: MOUSE BUTTON SPY {8110} V0
|
||||
10: REPORT RATE {8060} V0
|
||||
Report Rate: 1ms
|
||||
Report Rate (saved): 1ms
|
||||
Report Rate : 1ms
|
||||
11: ADJUSTABLE DPI {2201} V2
|
||||
Sensitivity (DPI) (saved): 800
|
||||
Sensitivity (DPI) : 800
|
||||
12: FORCE PAIRING {1500} V0
|
||||
13: DEVICE RESET {1802} V0 internal, hidden
|
||||
14: unknown:1803 {1803} V0 internal, hidden
|
||||
15: CONFIG DEVICE PROPS {1806} V4 internal, hidden
|
||||
16: unknown:1811 {1811} V0 internal, hidden
|
||||
17: OOBSTATE {1805} V0 internal, hidden
|
||||
18: unknown:1830 {1830} V0 internal, hidden
|
||||
19: unknown:1890 {1890} V5 internal, hidden
|
||||
20: unknown:1891 {1891} V5 internal, hidden
|
||||
21: unknown:18A1 {18A1} V0 internal, hidden
|
||||
22: unknown:1801 {1801} V0 internal, hidden
|
||||
23: unknown:18B1 {18B1} V0 internal, hidden
|
||||
24: unknown:1E00 {1E00} V0 hidden
|
||||
25: unknown:1EB0 {1EB0} V0 internal, hidden
|
||||
26: unknown:1863 {1863} V0 internal, hidden
|
||||
27: unknown:1E22 {1E22} V0 internal, hidden
|
||||
Battery: 71%, 0.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
solaar show
|
||||
rules cannot access modifier keys in Wayland, accessing process only works on GNOME with Solaar Gnome extension installed
|
||||
solaar version 1.1.14-2
|
||||
|
||||
Unifying Receiver
|
||||
Device path : /dev/hidraw1
|
||||
USB id : 046d:C52B
|
||||
Serial : EC219AC2
|
||||
C Pending : ff
|
||||
0 : 12.11.B0032
|
||||
1 : 04.16
|
||||
3 : AA.AA
|
||||
Has 2 paired device(s) out of a maximum of 6.
|
||||
Notifications: wireless (0x000100)
|
||||
Device activity counters: 1=195, 2=74
|
||||
|
||||
1: Wireless Mouse M175
|
||||
Device path : /dev/hidraw2
|
||||
WPID : 4008
|
||||
Codename : M175
|
||||
Kind : mouse
|
||||
Protocol : HID++ 2.0
|
||||
Report Rate : 8ms
|
||||
Serial number: 16E46E8C
|
||||
Model ID: 000000000000
|
||||
Unit ID: 00000000
|
||||
0: RQM 40.00.B0016
|
||||
The power switch is located on the base.
|
||||
Supports 21 HID++ 2.0 features:
|
||||
0: ROOT {0000} V0
|
||||
1: FEATURE SET {0001} V0
|
||||
2: DEVICE FW VERSION {0003} V0
|
||||
Firmware: 0 RQM 40.00.B0016 4008
|
||||
Unit ID: 00000000 Model ID: 000000000000 Transport IDs: {}
|
||||
3: DEVICE NAME {0005} V0
|
||||
Name: Wireless Mouse M185
|
||||
Kind: mouse
|
||||
4: BATTERY STATUS {1000} V0
|
||||
Battery: 70%, 0, next level 5%.
|
||||
5: unknown:1830 {1830} V0 internal, hidden
|
||||
6: unknown:1850 {1850} V0 internal, hidden
|
||||
7: unknown:1860 {1860} V0 internal, hidden
|
||||
8: unknown:1890 {1890} V0 internal, hidden
|
||||
9: unknown:18A0 {18A0} V0 internal, hidden
|
||||
10: unknown:18C0 {18C0} V0 internal, hidden
|
||||
11: WIRELESS DEVICE STATUS {1D4B} V0
|
||||
12: unknown:1DF3 {1DF3} V0 internal, hidden
|
||||
13: REPROG CONTROLS {1B00} V0
|
||||
14: REMAINING PAIRING {1DF0} V0 hidden
|
||||
Remaining Pairings: 117
|
||||
15: unknown:1E00 {1E00} V0 hidden
|
||||
16: unknown:1E80 {1E80} V0 internal, hidden
|
||||
17: unknown:1E90 {1E90} V0 internal, hidden
|
||||
18: unknown:1F03 {1F03} V0 internal, hidden
|
||||
19: VERTICAL SCROLLING {2100} V0
|
||||
Roller type: standard
|
||||
Ratchet per turn: 24
|
||||
Scroll lines: 0
|
||||
20: MOUSE POINTER {2200} V0
|
||||
DPI: 1000
|
||||
Acceleration: low
|
||||
Override OS ballistics
|
||||
No vertical tuning, standard mice
|
||||
Battery: 70%, 0, next level 5%.
|
||||
|
|
@ -67,6 +67,7 @@ Some of the languages Solaar has been translated to are listed below. A full lis
|
|||
- Spanish, Castilian: Jose Luis Tirado
|
||||
- Swedish: John Erling Blad, [Daniel Zippert][zipperten], Emelie Snecker, Jonatan Nyberg
|
||||
- Turkish: Osman Karagöz
|
||||
- Ukrainian: Олександр Афанасьєв
|
||||
|
||||
[Rongronggg9]: https://github.com/Rongronggg9
|
||||
[papoteur]: https://github.com/papoteur
|
||||
|
|
|
|||
|
|
@ -131,62 +131,6 @@ Solaar uses a standard system tray implementation; solaar-gnome3 is no longer re
|
|||
See [the installation page](https://pwr-solaar.github.io/Solaar/installation)
|
||||
for the step-by-step procedure for manual installation.
|
||||
|
||||
## Known Issues
|
||||
|
||||
- Onboard Profiles, when active, can prevent changes to other settings, such as Polling Rate, DPI, and various LED settings. Which settings are affected depends on the device. To make changes to affected settings, disable Onboard Profiles. If Onboard Profiles are later enabled the affected settings may change to the value in the profile.
|
||||
|
||||
- Solaar version 1.1.12 has a bug resulting in devices remaining in their default configuration after a system resume. This is fixed in 1.1.13.
|
||||
|
||||
- Bluez 5.73 does not remove Bluetooth devices when they disconnect.
|
||||
Solaar 1.1.12 processes the DBus disconnection and connection messages from Bluez and does re-initialize devices when they reconnect.
|
||||
The HID++ driver does not re-initialize devices, which causes problems with smooth scrolling.
|
||||
Until the problem is resolved having Scroll Wheel Resolution set to true (and not ignored) may be helpful.
|
||||
|
||||
- The Linux HID++ driver modifies the Scroll Wheel Resolution setting to
|
||||
implement smooth scrolling. If Solaar changes this setting, scrolling
|
||||
can be either very fast or very slow. To fix this problem
|
||||
click on the icon at the right edge of the setting to set it to
|
||||
"Ignore this setting", which is the default for new devices.
|
||||
The mouse has to be reset (e.g., by turning it off and on again) before this fix will take effect.
|
||||
|
||||
- Solaar expects that it has exclusive control over settings that are not ignored.
|
||||
Running other programs that modify these settings, such as logiops,
|
||||
will likely result in unexpected device behavior.
|
||||
|
||||
- The driver also sets the scrolling direction to its normal setting when implementing smooth scrolling.
|
||||
This can interfere with the Scroll Wheel Direction setting, requiring flipping this setting back and forth
|
||||
to restore reversed scrolling.
|
||||
|
||||
- The driver sends messages to devices that do not conform with the Logitech HID++ specification
|
||||
resulting in responses being sent back that look like other messages. For some devices this causes
|
||||
Solaar to report incorrect battery levels.
|
||||
|
||||
- Solaar normally uses icon names for its icons, which in some system tray implementations
|
||||
results in missing or wrong-sized icons.
|
||||
The `--tray-icon-size` option forces Solaar to use icon files of appropriate size
|
||||
for tray icons instead, which produces better results in some system tray implementations.
|
||||
To use icon files close to 32 pixels in size use `--tray-icon-size=32`.
|
||||
|
||||
- The icon in the system tray can show up as 'black on black' in dark
|
||||
themes or as non-symbolic when the theme uses symbolic icons. This is due to problems
|
||||
in some system tray implementations. Changing to a different theme may help.
|
||||
The `--battery-icons=symbolic` option can be used to force symbolic icons.
|
||||
|
||||
- Solaar will try to use uinput to simulate input from rules under Wayland or if Xtest is not available
|
||||
but this needs write permission on /dev/uinput.
|
||||
For more information see [the rules page](https://pwr-solaar.github.io/Solaar/rules).
|
||||
|
||||
- Diverted keys remain diverted and so do not have their normal behavior when Solaar terminates
|
||||
or a device disconnects from a host that is running Solaar. If necessary, their normal behavior
|
||||
can be reestablished by turning the device off and on again. This is most important to restore
|
||||
the host switching behavior of a host switch key that was diverted, for example to switch away
|
||||
from a host that crashed or was turned off.
|
||||
|
||||
- When a receiver-connected device changes hosts Solaar remembers which diverted keys were down on it.
|
||||
When the device changes back the first time any of these diverted keys is depressed Solaar will not
|
||||
realize that the key was newly depressed. For this reason Solaar rules that can change hosts should
|
||||
trigger on key releasing.
|
||||
|
||||
## License
|
||||
|
||||
This software is distributed under the terms of the
|
||||
|
|
|
|||
|
|
@ -27,6 +27,18 @@ brew update
|
|||
brew install hidapi gtk+3 pygobject3
|
||||
```
|
||||
|
||||
### Optional: Set up macOS launcher
|
||||
* Option A (recommended): Configure a LaunchAgent to automatically start Solaar and keep it running in the background.
|
||||
It will also automatically restart Solaar if it crashed or closed.
|
||||
```
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/pwr-Solaar/Solaar/refs/heads/master/tools/create-macos-app.sh)
|
||||
```
|
||||
* Option B: Create Solaar.app launcher in /Applications.
|
||||
It can be added to Login Items to start on login, but it will not automatically recover on crashes.
|
||||
```
|
||||
bash <(curl -fsSL https://raw.githubusercontent.com/pwr-Solaar/Solaar/refs/heads/master/tools/create-macos-launchagent.sh)
|
||||
```
|
||||
|
||||
# Installating from GitHub
|
||||
|
||||
## Downloading
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
title: Known Issues
|
||||
layout: page
|
||||
---
|
||||
|
||||
# Known Issues
|
||||
|
||||
- Some internal structures in Solaar have been updated to use more standard Python language features.
|
||||
This has caused some problems and introduced bugs are still being found.
|
||||
|
||||
- Onboard Profiles, when active, can prevent changes to other settings, such as Polling Rate, DPI, and various LED settings. Which settings are affected depends on the device. To make changes to affected settings, disable Onboard Profiles. If Onboard Profiles are later enabled the affected settings may change to the value in the profile.
|
||||
|
||||
- Bluez 5.73 does not remove Bluetooth devices when they disconnect.
|
||||
Solaar 1.1.12 processes the DBus disconnection and connection messages from Bluez and does re-initialize devices when they reconnect.
|
||||
The HID++ driver does not re-initialize devices, which causes problems with smooth scrolling.
|
||||
Until the problem is resolved having Scroll Wheel Resolution set to true (and not ignored) may be helpful.
|
||||
|
||||
- The Linux HID++ driver modifies the Scroll Wheel Resolution setting to
|
||||
implement smooth scrolling. If Solaar changes this setting, scrolling
|
||||
can be either very fast or very slow. To fix this problem
|
||||
click on the icon at the right edge of the setting to set it to
|
||||
"Ignore this setting", which is the default for new devices.
|
||||
The mouse has to be reset (e.g., by turning it off and on again) before this fix will take effect.
|
||||
|
||||
- Solaar expects that it has exclusive control over settings that are not ignored.
|
||||
Running other programs that modify these settings, such as logiops,
|
||||
will likely result in unexpected device behavior.
|
||||
|
||||
- The driver also sets the scrolling direction to its normal setting when implementing smooth scrolling.
|
||||
This can interfere with the Scroll Wheel Direction setting, requiring flipping this setting back and forth
|
||||
to restore reversed scrolling.
|
||||
|
||||
- The driver sends messages to devices that do not conform with the Logitech HID++ specification
|
||||
resulting in responses being sent back that look like other messages. For some devices this causes
|
||||
Solaar to report incorrect battery levels.
|
||||
|
||||
- Solaar normally uses icon names for its icons, which in some system tray implementations
|
||||
results in missing or wrong-sized icons.
|
||||
The `--tray-icon-size` option forces Solaar to use icon files of appropriate size
|
||||
for tray icons instead, which produces better results in some system tray implementations.
|
||||
To use icon files close to 32 pixels in size use `--tray-icon-size=32`.
|
||||
|
||||
- The icon in the system tray can show up as 'black on black' in dark
|
||||
themes or as non-symbolic when the theme uses symbolic icons. This is due to problems
|
||||
in some system tray implementations. Changing to a different theme may help.
|
||||
The `--battery-icons=symbolic` option can be used to force symbolic icons.
|
||||
|
||||
- Solaar will try to use uinput to simulate input from rules under Wayland or if Xtest is not available
|
||||
but this needs write permission on /dev/uinput.
|
||||
For more information see [the rules page](https://pwr-solaar.github.io/Solaar/rules).
|
||||
|
||||
- Diverted keys remain diverted and so do not have their normal behavior when Solaar terminates
|
||||
or a device disconnects from a host that is running Solaar. If necessary, their normal behavior
|
||||
can be reestablished by turning the device off and on again. This is most important to restore
|
||||
the host switching behavior of a host switch key that was diverted, for example to switch away
|
||||
from a host that crashed or was turned off.
|
||||
|
||||
- When a receiver-connected device changes hosts Solaar remembers which diverted keys were down on it.
|
||||
When the device changes back the first time any of these diverted keys is depressed Solaar will not
|
||||
realize that the key was newly depressed. For this reason Solaar rules that can change hosts should
|
||||
trigger on key releasing.
|
||||
|
|
@ -133,8 +133,9 @@ or the window's Window manager class or instance name starts with their string a
|
|||
`Device` conditions are true if a particular device originated the notification.
|
||||
`Active` conditions are true if a particular device is active.
|
||||
`Device` and `Active` conditions take one argument, which is the serial number or unit ID of a device,
|
||||
as shown in Solaar's detail pane.
|
||||
Some older devices do not have a useful serial number or unit ID and so cannot be tested for by these conditions.
|
||||
as shown in Solaar's detail pane, or either of its names, as shown by Solaar.
|
||||
Some older devices do not have a useful serial number or unit ID and so cannot
|
||||
distinguished from other devices with the same names.
|
||||
|
||||
### Host
|
||||
`Host` conditions are true if the computers hostname starts with the condition's argument.
|
||||
|
|
@ -244,7 +245,8 @@ If the previous condition in the parent rule returns a number the scroll amounts
|
|||
### Mouse click
|
||||
A `MouseClick` action takes a mouse button name (`left`, `middle` or `right`) and a positive number or 'click', 'depress', or 'release'.
|
||||
The action simulates that number of clicks of the specified button or just one click, depress, or release of the button.
|
||||
A `MouseClick` action takes a mouse button name (`left`, `middle` or `right`) and a positive number, and simulates that number of clicks of the specified button.
|
||||
|
||||
### Execute
|
||||
An `Execute` action takes a program and arguments and executes it asynchronously.
|
||||
|
||||
### Set setting
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ def open_path(device_path):
|
|||
if e.errno == errno.EACCES:
|
||||
sleep(0.1)
|
||||
else:
|
||||
raise
|
||||
raise e
|
||||
|
||||
|
||||
def close(device_handle) -> None:
|
||||
|
|
|
|||
|
|
@ -87,10 +87,10 @@ def create_device(low_level: LowLevelInterface, device_info, setting_callback=No
|
|||
except OSError as e:
|
||||
logger.exception("open %s", device_info)
|
||||
if e.errno == errno.EACCES:
|
||||
raise
|
||||
except Exception:
|
||||
raise e
|
||||
except Exception as e:
|
||||
logger.exception("open %s", device_info)
|
||||
raise
|
||||
raise e
|
||||
|
||||
|
||||
class Device:
|
||||
|
|
@ -207,10 +207,10 @@ class Device:
|
|||
|
||||
Device.instances.append(self)
|
||||
|
||||
def find(self, id): # find a device by serial number or unit ID
|
||||
assert id, "need serial number or unit ID to find a device"
|
||||
def find(self, id): # find a device by serial number or unit ID or name or codename
|
||||
assert id, "need id to find a device"
|
||||
for device in Device.instances:
|
||||
if device.online and (device.unitId == id or device.serial == id):
|
||||
if device.online and (device.unitId == id or device.serial == id or device.name == id or device.codename == id):
|
||||
return device
|
||||
|
||||
@property
|
||||
|
|
@ -397,7 +397,7 @@ class Device:
|
|||
self.persister["_battery"] = feature.value
|
||||
return battery
|
||||
except Exception:
|
||||
if self.persister and battery_feature is None and result is not None:
|
||||
if self.persister and battery_feature is None and result is not None and result != 0:
|
||||
self.persister["_battery"] = result.value
|
||||
|
||||
def set_battery_info(self, info):
|
||||
|
|
@ -522,7 +522,7 @@ class Device:
|
|||
self.hidpp_long is None and (self.bluetooth or self._protocol is not None and self._protocol >= 2.0)
|
||||
)
|
||||
return self.low_level.request(
|
||||
self.handle or self.receiver.handle,
|
||||
self.handle or (self.receiver.handle if self.receiver else None),
|
||||
self.number,
|
||||
request_id,
|
||||
*params,
|
||||
|
|
|
|||
|
|
@ -1118,7 +1118,12 @@ class Device(Condition):
|
|||
def evaluate(self, feature, notification: HIDPPNotification, device, last_result):
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("evaluate condition: %s", self)
|
||||
return device.unitId == self.devID or device.serial == self.devID
|
||||
return (
|
||||
device.unitId == self.devID
|
||||
or device.serial == self.devID
|
||||
or device.codename == self.devID
|
||||
or device.name == self.devID
|
||||
)
|
||||
|
||||
def data(self):
|
||||
return {"Device": self.devID}
|
||||
|
|
@ -1316,17 +1321,17 @@ class MouseClick(Action):
|
|||
self.count = count
|
||||
elif warn:
|
||||
logger.warning(
|
||||
"rule MouseClick action: argument %s should be an integer or CLICK, PRESS, or RELEASE",
|
||||
"rule MouseClick action: argument %s should be an integer or click, depress, or release",
|
||||
count,
|
||||
)
|
||||
self.count = 1
|
||||
|
||||
def __str__(self):
|
||||
return f"MouseClick: {self.button} ({int(self.count)})"
|
||||
return f"MouseClick: {self.button} ({str(self.count)})"
|
||||
|
||||
def evaluate(self, feature, notification: HIDPPNotification, device, last_result):
|
||||
if logger.isEnabledFor(logging.INFO):
|
||||
logger.info(f"MouseClick action: {int(self.count)} {self.button}")
|
||||
logger.info(f"MouseClick action: {str(self.count)} {self.button}")
|
||||
if self.button and self.count:
|
||||
click(buttons[self.button], self.count)
|
||||
time.sleep(0.01)
|
||||
|
|
@ -1494,7 +1499,7 @@ def key_is_down(key: NamedInt) -> bool:
|
|||
|
||||
def evaluate_rules(feature, notification: HIDPPNotification, device):
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug("evaluating rules on %s", notification)
|
||||
logger.debug("evaluating rules on %s %s", feature, notification)
|
||||
rules.evaluate(feature, notification, device, True)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ from .hidpp20_constants import DEVICE_KIND
|
|||
from .hidpp20_constants import ChargeLevel
|
||||
from .hidpp20_constants import ChargeType
|
||||
from .hidpp20_constants import ErrorCode
|
||||
from .hidpp20_constants import FeatureFlag
|
||||
from .hidpp20_constants import GestureId
|
||||
from .hidpp20_constants import ParamId
|
||||
from .hidpp20_constants import SupportedFeature
|
||||
|
|
@ -79,6 +80,9 @@ class Device(Protocol):
|
|||
...
|
||||
|
||||
|
||||
# pfps: Consider adding a class method that sanitizes inputs by removing unknown bits.
|
||||
|
||||
|
||||
class KeyFlag(Flag):
|
||||
"""Capabilities and desired software handling for a control.
|
||||
|
||||
|
|
@ -86,6 +90,11 @@ class KeyFlag(Flag):
|
|||
We treat bytes 4 and 8 of `getCidInfo` as a single bitfield.
|
||||
"""
|
||||
|
||||
UNUSED_8000 = 0x8000
|
||||
UNUSED_4000 = 0x4000
|
||||
UNUSED_2000 = 0x2000
|
||||
UNUSED_1000 = 0x1000
|
||||
RAW_WHEEL = 0x800
|
||||
ANALYTICS_KEY_EVENTS = 0x400
|
||||
FORCE_RAW_XY = 0x200
|
||||
RAW_XY = 0x100
|
||||
|
|
@ -105,6 +114,9 @@ class MappingFlag(Flag):
|
|||
We treat bytes 2 and 5 of `get/setCidReporting` as a single bitfield
|
||||
"""
|
||||
|
||||
UNUSED_4000 = 0x4000
|
||||
UNUSED_1000 = 0x1000
|
||||
RAW_WHEEL = 0x400
|
||||
ANALYTICS_KEY_EVENTS_REPORTING = 0x100
|
||||
FORCE_RAW_XY_DIVERTED = 0x40
|
||||
RAW_XY_DIVERTED = 0x10
|
||||
|
|
@ -126,6 +138,7 @@ class FeaturesArray(dict):
|
|||
self.device = device
|
||||
self.inverse = {}
|
||||
self.version = {}
|
||||
self.flags = {}
|
||||
self.count = 0
|
||||
|
||||
def _check(self) -> bool:
|
||||
|
|
@ -172,6 +185,7 @@ class FeaturesArray(dict):
|
|||
feature = f"unknown:{data:04X}"
|
||||
self[feature] = index
|
||||
self.version[feature] = response[3]
|
||||
self.flags[feature] = response[2]
|
||||
return feature
|
||||
|
||||
def enumerate(self): # return all features and their index, ordered by index
|
||||
|
|
@ -184,6 +198,15 @@ class FeaturesArray(dict):
|
|||
if self[feature]:
|
||||
return self.version.get(feature, 0)
|
||||
|
||||
def get_flags(self, feature: NamedInt) -> Optional[int]:
|
||||
if self[feature]:
|
||||
return self.flags.get(feature, 0)
|
||||
|
||||
def get_hidden(self, feature: NamedInt) -> Optional[bool]:
|
||||
if self[feature]:
|
||||
return self.flags.get(feature, 0) & FeatureFlag.INTERNAL
|
||||
return True
|
||||
|
||||
def __contains__(self, feature: NamedInt) -> bool:
|
||||
try:
|
||||
index = self.__getitem__(feature)
|
||||
|
|
@ -204,6 +227,7 @@ class FeaturesArray(dict):
|
|||
index = response[0]
|
||||
self[feature] = index if index else False
|
||||
self.version[feature] = response[2]
|
||||
self.flags[feature] = response[1]
|
||||
return index if index else False
|
||||
|
||||
def __setitem__(self, feature, index):
|
||||
|
|
@ -296,7 +320,10 @@ class ReprogrammableKeyV4(ReprogrammableKey):
|
|||
if self._mapped_to is None:
|
||||
self._getCidReporting()
|
||||
self._device.keys._ensure_all_keys_queried()
|
||||
task = str(special_keys.Task(self._device.keys.cid_to_tid[self._mapped_to]))
|
||||
try:
|
||||
task = str(special_keys.Task(self._device.keys.cid_to_tid[self._mapped_to]))
|
||||
except ValueError:
|
||||
task = f"Unknown_{self._mapped_to:x}"
|
||||
return NamedInt(self._mapped_to, task)
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ def _process_feature_notification(device: Device, notification: HIDPPNotificatio
|
|||
result = hidpp20.decipher_adc_measurement(notification.data)
|
||||
if result: # if good data and the device was not present then a push is needed
|
||||
device.set_battery_info(result[1])
|
||||
device.changed(active=True, alert=Alert.ALL, reason=_("ADC measurement notification"), push=not old_present)
|
||||
device.changed(active=True, alert=Alert.NONE, reason=_("ADC measurement notification"), push=not old_present)
|
||||
else: # this feature is also used to signal device becoming inactive
|
||||
device.present = False # exception to device presence
|
||||
device.changed(active=False)
|
||||
|
|
|
|||
|
|
@ -599,6 +599,6 @@ def create_receiver(low_level: LowLevelInterface, device_info, setting_callback=
|
|||
except OSError as e:
|
||||
logger.exception("open %s", device_info)
|
||||
if e.errno == errno.EACCES:
|
||||
raise
|
||||
raise e
|
||||
except Exception:
|
||||
logger.exception("open %s", device_info)
|
||||
|
|
|
|||
|
|
@ -99,8 +99,11 @@ class State(enum.Enum):
|
|||
# mask is used to keep only some bits from a sequence of bits, this can be an integer or a byte string,
|
||||
# read_skip_byte_count is the number of bytes to ignore at the beginning of the read value (default 0),
|
||||
# write_prefix_bytes is a byte string to write before the value (default empty).
|
||||
|
||||
# RangeValidator is for an integer in a range. It takes
|
||||
# byte_count is number of bytes that the value is stored in (defaults to size of max_value).
|
||||
# read_skip_byte_count is as for BooleanV
|
||||
# write_prefix_bytes is as for BooleanV
|
||||
# RangeValidator uses min_value and max_value from the setting class as minimum and maximum.
|
||||
|
||||
# ChoicesValidator is for symbolic choices. It takes one positional and three keyword arguments:
|
||||
|
|
@ -698,6 +701,38 @@ class ScrollRatchetEnhanced(ScrollRatchet):
|
|||
rw_options = {"read_fnid": 0x10, "write_fnid": 0x20}
|
||||
|
||||
|
||||
class ScrollRatchetTorque(settings.Setting):
|
||||
name = "scroll-ratchet-torque"
|
||||
label = _("Scroll Wheel Ratchet Torque")
|
||||
description = _("Change the torque needed to overcome the ratchet.")
|
||||
feature = _F.SMART_SHIFT_ENHANCED
|
||||
min_value = 1
|
||||
max_value = 100
|
||||
rw_options = {"read_fnid": 0x10, "write_fnid": 0x20}
|
||||
|
||||
class rw_class(settings.FeatureRW):
|
||||
def write(self, device, data_bytes):
|
||||
ratchetSetting = next(filter(lambda s: s.name == "scroll-ratchet", device.settings), None)
|
||||
if ratchetSetting: # for MX Master 4, the ratchet setting needs to be written for changes to take effect
|
||||
ratchet_value = ratchetSetting.read(True)
|
||||
data_bytes = ratchet_value.to_bytes(1, "big") + data_bytes[1:]
|
||||
result = super().write(device, data_bytes)
|
||||
return result
|
||||
|
||||
class validator_class(settings_validator.RangeValidator):
|
||||
@classmethod
|
||||
def build(cls, setting_class, device):
|
||||
reply = device.feature_request(_F.SMART_SHIFT_ENHANCED, 0x00)
|
||||
if reply[0] & 0x01: # device supports tunable torque
|
||||
return cls(
|
||||
min_value=setting_class.min_value,
|
||||
max_value=setting_class.max_value,
|
||||
byte_count=1,
|
||||
write_prefix_bytes=b"\x00\x00", # don't change mode or disengage, but see above
|
||||
read_skip_byte_count=2,
|
||||
)
|
||||
|
||||
|
||||
# the keys for the choice map are Logitech controls (from special_keys)
|
||||
# each choice value is a NamedInt with the string from a task (to be shown to the user)
|
||||
# and the integer being the control number for that task (to be written to the device)
|
||||
|
|
@ -1756,6 +1791,7 @@ SETTINGS: list[settings.Setting] = [
|
|||
HiresSmoothResolution, # working
|
||||
HiresMode, # simple
|
||||
ScrollRatchet, # simple
|
||||
ScrollRatchetTorque,
|
||||
SmartShift, # working
|
||||
ScrollRatchetEnhanced,
|
||||
SmartShiftEnhanced, # simple
|
||||
|
|
@ -1898,6 +1934,8 @@ def check_feature(device, settings_class: SettingsProtocol) -> None | bool | Set
|
|||
return
|
||||
if settings_class.min_version > device.features.get_feature_version(settings_class.feature):
|
||||
return
|
||||
if device.features.get_hidden(settings_class.feature):
|
||||
return
|
||||
try:
|
||||
detected = settings_class.build(device)
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
|
|
|
|||
|
|
@ -531,12 +531,13 @@ class RangeValidator(Validator):
|
|||
kwargs["max_value"] = setting_class.max_value
|
||||
return cls(**kwargs)
|
||||
|
||||
def __init__(self, min_value=0, max_value=255, byte_count=1):
|
||||
def __init__(self, min_value=0, max_value=255, byte_count=1, read_skip_byte_count=0, write_prefix_bytes=b""):
|
||||
assert max_value > min_value
|
||||
self.min_value = min_value
|
||||
self.max_value = max_value
|
||||
self.read_skip_byte_count = read_skip_byte_count
|
||||
self.write_prefix_bytes = write_prefix_bytes
|
||||
self.needs_current_value = True # read and check before write (needed for ADC power and probably a good idea anyway)
|
||||
|
||||
self._byte_count = math.ceil(math.log(max_value + 1, 256))
|
||||
if byte_count:
|
||||
assert self._byte_count <= byte_count
|
||||
|
|
@ -544,7 +545,7 @@ class RangeValidator(Validator):
|
|||
assert self._byte_count < 8
|
||||
|
||||
def validate_read(self, reply_bytes):
|
||||
reply_value = common.bytes2int(reply_bytes[: self._byte_count])
|
||||
reply_value = common.bytes2int(reply_bytes[self.read_skip_byte_count : self.read_skip_byte_count + self._byte_count])
|
||||
assert reply_value >= self.min_value, f"{self.__class__.__name__}: failed to validate read value {reply_value:02X}"
|
||||
assert reply_value <= self.max_value, f"{self.__class__.__name__}: failed to validate read value {reply_value:02X}"
|
||||
return reply_value
|
||||
|
|
@ -553,7 +554,7 @@ class RangeValidator(Validator):
|
|||
if new_value < self.min_value or new_value > self.max_value:
|
||||
raise ValueError(f"invalid choice {new_value!r}")
|
||||
current_value = self.validate_read(current_value) if current_value is not None else None
|
||||
to_write = common.int2bytes(new_value, self._byte_count)
|
||||
to_write = self.write_prefix_bytes + common.int2bytes(new_value, self._byte_count)
|
||||
# current value is known and same as value to be written return None to signal not to write it
|
||||
return None if current_value is not None and current_value == new_value else to_write
|
||||
|
||||
|
|
|
|||
|
|
@ -29,19 +29,22 @@ from .common import UnsortedNamedInts
|
|||
_XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME") or os.path.expanduser(os.path.join("~", ".config"))
|
||||
_keys_file_path = os.path.join(_XDG_CONFIG_HOME, "solaar", "keys.yaml")
|
||||
|
||||
|
||||
# Original set done as
|
||||
# <controls.xml awk -F\" '/<Control /{sub(/^LD_FINFO_(CTRLID_)?/, "", $2);printf("\t%s=0x%04X,\n", $2, $4)}' | sort -t= -k2
|
||||
# Keys added afterwards based on information from Logitech and users
|
||||
CONTROL = NamedInts(
|
||||
{
|
||||
"Volume_Up": 0x0001,
|
||||
"Volume_Down": 0x0002,
|
||||
"Volume_Up_old": 0x0001,
|
||||
"Volume_Down_old": 0x0002,
|
||||
"Mute": 0x0003,
|
||||
"Play__Pause": 0x0004,
|
||||
"Play__Pause_old": 0x0004,
|
||||
"Next": 0x0005,
|
||||
"Previous": 0x0006,
|
||||
"Stop": 0x0007,
|
||||
"Application_Switcher": 0x0008,
|
||||
"Burn": 0x0009,
|
||||
"Calculator": 0x000A, # Craft Keyboard top 4th from right
|
||||
"Calculator": 0x000A, # Craft Keyboard top 4th from right; Logitech
|
||||
"Calendar": 0x000B,
|
||||
"Close": 0x000C,
|
||||
"Eject": 0x000D,
|
||||
|
|
@ -55,7 +58,7 @@ CONTROL = NamedInts(
|
|||
"Undo_As_HID": 0x0015,
|
||||
"Redo_As_Ctrl_Y": 0x0016,
|
||||
"Redo_As_HID": 0x0017,
|
||||
"Print_As_Ctrl_P": 0x0018,
|
||||
"Print_As_Ctrl_P": 0x0018, # Logitech, modified
|
||||
"Print_As_HID": 0x0019,
|
||||
"Save_As_Ctrl_S": 0x001A,
|
||||
"Save_As_HID": 0x001B,
|
||||
|
|
@ -110,13 +113,13 @@ CONTROL = NamedInts(
|
|||
"Pause_Break": 0x004D,
|
||||
"Scroll_Lock": 0x004E,
|
||||
"Contextual_Menu": 0x004F,
|
||||
"Left_Button": 0x0050, # LEFT_CLICK
|
||||
"Right_Button": 0x0051, # RIGHT_CLICK
|
||||
"Middle_Button": 0x0052, # MIDDLE_BUTTON
|
||||
"Back_Button": 0x0053, # from M510v2 was BACK_AS_BUTTON_4
|
||||
"Left_Button": 0x0050, # LEFT_CLICK; Logitech
|
||||
"Right_Button": 0x0051, # RIGHT_CLICK; Logitech
|
||||
"Middle_Button": 0x0052, # MIDDLE_BUTTON; Logitech
|
||||
"Back_Button": 0x0053, # from M510v2 was BACK_AS_BUTTON_4; Logitech
|
||||
"Back": 0x0054, # BACK_AS_HID
|
||||
"Back_As_Alt_Win_Arrow": 0x0055,
|
||||
"Forward_Button": 0x0056, # from M510v2 was FORWARD_AS_BUTTON_5
|
||||
"Forward_Button": 0x0056, # from M510v2 was FORWARD_AS_BUTTON_5; Logitech
|
||||
"Forward_As_HID": 0x0057,
|
||||
"Forward_As_Alt_Win_Arrow": 0x0058,
|
||||
"Button_6": 0x0059,
|
||||
|
|
@ -140,8 +143,8 @@ CONTROL = NamedInts(
|
|||
"Button_22": 0x006B,
|
||||
"Button_23": 0x006C,
|
||||
"Button_24": 0x006D,
|
||||
"Show_Desktop": 0x006E, # Craft Keyboard Fn F5
|
||||
"Lock_PC": 0x006F, # Craft Keyboard top 1st from right
|
||||
"Show_Desktop": 0x006E, # Craft Keyboard Fn F5; Logitch
|
||||
"Screen_Lock": 0x006F, # Craft Keyboard top 1st from right; Logitech
|
||||
"Fn_F1": 0x0070,
|
||||
"Fn_F2": 0x0071,
|
||||
"Fn_F3": 0x0072,
|
||||
|
|
@ -189,7 +192,7 @@ CONTROL = NamedInts(
|
|||
"Metro_Search": 0x00A3,
|
||||
"Combo_Sleep": 0x00A4,
|
||||
"Metro_Share": 0x00A5,
|
||||
"Metro_Settings": 0x00A6,
|
||||
"OS_Settings": 0x00A6, # Logitech
|
||||
"Metro_Devices": 0x00A7,
|
||||
"Metro_Start_Screen": 0x00A9,
|
||||
"Zoomin": 0x00AA,
|
||||
|
|
@ -212,23 +215,23 @@ CONTROL = NamedInts(
|
|||
"Fn_Down": 0x00C0,
|
||||
"Fn_Up": 0x00C1,
|
||||
"Multiplatform_Lock": 0x00C2,
|
||||
"Mouse_Gesture_Button": 0x00C3, # Thumb_Button on MX Master - Logitech name App_Switch_Gesture
|
||||
"Smart_Shift": 0x00C4, # Top_Button on MX Master
|
||||
"Mouse_Gesture_Button": 0x00C3, # Thumb_Button on MX Master - Logitech name App_Switch_Gesture; Logitech
|
||||
"Smart_Shift": 0x00C4, # Top_Button on MX Master; Logitech
|
||||
"Microphone": 0x00C5,
|
||||
"Wifi": 0x00C6,
|
||||
"Brightness_Down": 0x00C7, # Craft Keyboard Fn F1
|
||||
"Brightness_Up": 0x00C8, # Craft Keyboard Fn F2
|
||||
"Brightness_Down": 0x00C7, # Craft Keyboard Fn F1, Logitech
|
||||
"Brightness_Up": 0x00C8, # Craft Keyboard Fn F2, Logitech
|
||||
"Display_Out__Project_Screen_": 0x00C9,
|
||||
"View_Open_Apps": 0x00CA,
|
||||
"View_All_Apps": 0x00CB,
|
||||
"Switch_App": 0x00CC,
|
||||
"Fn_Inversion_Change": 0x00CD,
|
||||
"MultiPlatform_Back": 0x00CE,
|
||||
"MultiPlatform_Back": 0x00CE, # Logitech
|
||||
"MultiPlatform_Forward": 0x00CF,
|
||||
"MultiPlatform_Gesture_Button": 0x00D0,
|
||||
"Host_Switch_Channel_1": 0x00D1, # Craft Keyboard
|
||||
"Host_Switch_Channel_2": 0x00D2, # Craft Keyboard
|
||||
"Host_Switch_Channel_3": 0x00D3, # Craft Keyboard
|
||||
"Host_Switch_Channel_1": 0x00D1, # Craft Keyboard; Logitech
|
||||
"Host_Switch_Channel_2": 0x00D2, # Craft Keyboard; Logitech
|
||||
"Host_Switch_Channel_3": 0x00D3, # Craft Keyboard; Logitech
|
||||
"MultiPlatform_Search": 0x00D4,
|
||||
"MultiPlatform_Home__Mission_Control": 0x00D5,
|
||||
"MultiPlatform_Menu__Show__Hide_Virtual_Keyboard__Launchpad": 0x00D6,
|
||||
|
|
@ -241,21 +244,21 @@ CONTROL = NamedInts(
|
|||
"Multi_Platform_Language_Switch": 0x00DD,
|
||||
"F_Lock": 0x00DE,
|
||||
"Switch_Highlight": 0x00DF,
|
||||
"Mission_Control__Task_View": 0x00E0, # Craft Keyboard Fn F3 Switch_Workspace
|
||||
"Mission_Control__Task_View": 0x00E0, # Craft Keyboard Fn F3 Switch_Workspace; Logitech
|
||||
"Dashboard_Launchpad__Action_Center": 0x00E1, # Craft Keyboard Fn F4 Application_Launcher
|
||||
"Backlight_Down": 0x00E2, # Craft Keyboard Fn F6
|
||||
"Backlight_Up": 0x00E3, # Craft Keyboard Fn F7
|
||||
"Previous_Fn": 0x00E4, # Craft Keyboard Fn F8 Previous_Track
|
||||
"Play__Pause_Fn": 0x00E5, # Craft Keyboard Fn F9 Play__Pause
|
||||
"Next_Fn": 0x00E6, # Craft Keyboard Fn F10 Next_Track
|
||||
"Mute_Fn": 0x00E7, # Craft Keyboard Fn F11 Mute
|
||||
"Volume_Down_Fn": 0x00E8, # Craft Keyboard Fn F12 Volume_Down
|
||||
"Volume_Up_Fn": 0x00E9, # Craft Keyboard next to F12 Volume_Down
|
||||
"Backlight_Down": 0x00E2, # Craft Keyboard Fn F6, Logitech
|
||||
"Backlight_Up": 0x00E3, # Craft Keyboard Fn F7, Logitech
|
||||
"Previous_Track": 0x00E4, # Craft Keyboard Fn F8 Previous_Track; Logitech
|
||||
"Play__Pause": 0x00E5, # Craft Keyboard Fn F9 Play__Pause; Logitech
|
||||
"Next_Track": 0x00E6, # Craft Keyboard Fn F10 Next_Track; Logitech
|
||||
"Mute_Sound": 0x00E7, # Craft Keyboard Fn F11 Mute; Logitech
|
||||
"Volume_Down": 0x00E8, # Craft Keyboard Fn F12 Volume_Down; Logitech
|
||||
"Volume_Up": 0x00E9, # Craft Keyboard next to F12 Volume_Down; Logitech
|
||||
"App_Contextual_Menu__Right_Click": 0x00EA, # Craft Keyboard top 2nd from right
|
||||
"Right_Arrow": 0x00EB,
|
||||
"Left_Arrow": 0x00EC,
|
||||
"DPI_Change": 0x00ED,
|
||||
"New_Tab": 0x00EE,
|
||||
"Open_New_Tab": 0x00EE, # Logitech
|
||||
"F2": 0x00EF,
|
||||
"F3": 0x00F0,
|
||||
"F4": 0x00F1,
|
||||
|
|
@ -271,20 +274,20 @@ CONTROL = NamedInts(
|
|||
"Laser_Button_Short_Press": 0x00FB,
|
||||
"Laser_Button_Long_Press": 0x00FC,
|
||||
"DPI_Switch": 0x00FD,
|
||||
"Multiplatform_Home__Show_Desktop": 0x00FE,
|
||||
"Multiplatform_Home__Show_Desktop": 0x00FE, # Logitech
|
||||
"Multiplatform_App_Switch__Show_Dashboard": 0x00FF,
|
||||
"Multiplatform_App_Switch_2": 0x0100, # Multiplatform_App_Switch
|
||||
"Fn_Inversion__Hot_Key": 0x0101,
|
||||
"LeftAndRightClick": 0x0102,
|
||||
"Voice_Dictation": 0x0103, # MX Keys for Business Fn F5 ; MX Mini Fn F6 Dictation
|
||||
"Emoji_Smiley_Heart_Eyes": 0x0104,
|
||||
"Emoji_Crying_Face": 0x0105,
|
||||
"Emoji_Smiley": 0x0106,
|
||||
"Emoji_Smilie_With_Tears": 0x0107,
|
||||
"Open_Emoji_Panel": 0x0108, # MX Keys for Business Fn F6 ; MX Mini Fn F7 Emoji
|
||||
"Multiplatform_App_Switch__Launchpad": 0x0109,
|
||||
"Snipping_Tool": 0x010A, # MX Keys for Business top 3rd from right; MX Mini Fn F8 Screenshot
|
||||
"Grave_Accent": 0x010B,
|
||||
"Dictation": 0x0103, # MX Keys for Business Fn F5 ; MX Mini Fn F6 Dictation; Logitech
|
||||
"Emoji_Smiley_Heart_Eyes": 0x0104, # Logitech
|
||||
"Emoji_Crying_Face": 0x0105, # Logitech
|
||||
"Emoji_Smiley": 0x0106, # Logitech
|
||||
"Emoji_Smilie_With_Tears": 0x0107, # Logitech
|
||||
"Emoji": 0x0108, # MX Keys for Business Fn F6 ; MX Mini Fn F7 Emoji, Logitech
|
||||
"Multiplatform_App_Switch__Launchpad": 0x0109, # Logitech
|
||||
"Screen_Capture": 0x010A, # MX Keys for Business top 3rd from right; MX Mini Fn F8 Screenshot; Logitech
|
||||
"Grave_Accent": 0x010B, # Logitech
|
||||
"Tab_Key": 0x010C,
|
||||
"Caps_Lock": 0x010D,
|
||||
"Left_Shift": 0x010E,
|
||||
|
|
@ -297,21 +300,31 @@ CONTROL = NamedInts(
|
|||
"Right_Shift": 0x0115,
|
||||
"Insert": 0x0116,
|
||||
"Delete": 0x0117, # MX Mini Lock (on delete key in function row)
|
||||
"Home": 0x118,
|
||||
"End": 0x119,
|
||||
"Home": 0x118, # Logitech
|
||||
"End": 0x119, # Logitech
|
||||
"Page_Up": 0x11A,
|
||||
"Page_Down": 0x11B,
|
||||
"Mute_Microphone": 0x11C, # MX Keys for Business Fn F7 ; MX Mini Fn F9 Microphone Mute
|
||||
"Do_Not_Disturb": 0x11D,
|
||||
"Mute_Microphone": 0x11C, # MX Keys for Business Fn F7 ; MX Mini Fn F9 Microphone Mute; Logitech
|
||||
"Do_Not_Disturb": 0x11D, # Logitech
|
||||
"Backslash": 0x11E,
|
||||
"Refresh": 0x11F,
|
||||
"Refresh": 0x11F, # Logitech
|
||||
"Close_Tab": 0x120,
|
||||
"Lang_Switch": 0x121,
|
||||
"Lang_Switch": 0x121, # Logitech
|
||||
"Standard_Key_A": 0x122,
|
||||
"Standard_Key_B": 0x123,
|
||||
"Standard_Key_C": 0x124, # There are lots more of these
|
||||
"Right_Option__Start__2": 0x013C, # On MX Mechanical Mini
|
||||
"Play_Pause": 0x0141, # On MX Mechanical Mini
|
||||
"Play__Pause_mini": 0x0141, # On MX Mechanical Mini
|
||||
"Haptic": 0x01A0, # Logitech
|
||||
"Circle": 0x01A3,
|
||||
"Triangle": 0x01A4,
|
||||
"Diamond": 0x01A5,
|
||||
"Star": 0x01A6,
|
||||
"Cut": 0x1A9, # Logitech
|
||||
"Copy": 0x1AA, # Logitech
|
||||
"Paste": 0x1AB, # Logitech
|
||||
"Video_On_Off": 0x01AC, # Logitech
|
||||
"AI": 0x1B4, # Logitech
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ def _process_add(device_info: DeviceInfo, retry):
|
|||
except OSError as e:
|
||||
if e.errno == errno.EACCES:
|
||||
try:
|
||||
output = subprocess.check_output(["/usr/bin/getfacl", "-p", device_info.path], text=True)
|
||||
output = subprocess.check_output(["getfacl", "-p", device_info.path], text=True)
|
||||
logger.warning("Missing permissions on %s\n%s.", device_info.path, output)
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -869,7 +869,7 @@ class SmartComboBox(Gtk.ComboBox):
|
|||
self._all_values = []
|
||||
self._blank = blank
|
||||
self._model = None
|
||||
self._commpletion = completion
|
||||
self._completion = completion
|
||||
self._case_insensitive = case_insensitive
|
||||
self._norm = lambda s: None if s is None else s if not case_insensitive else str(s).upper()
|
||||
self._replace_with_default_name = replace_with_default_name
|
||||
|
|
@ -921,7 +921,7 @@ class SmartComboBox(Gtk.ComboBox):
|
|||
if visible:
|
||||
to_complete += names if names else [str(value).strip()]
|
||||
self.set_model(filtered_model)
|
||||
if self.get_has_entry() and self._commpletion:
|
||||
if self.get_has_entry() and self._completion:
|
||||
CompletionEntry.add_completion_to_entry(self.get_child(), to_complete)
|
||||
if self._find_idx(old_value) is not None:
|
||||
self.set_value(old_value)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class KeyPressUI(ActionUI):
|
|||
self.label = Gtk.Label(
|
||||
label=_("Simulate a chorded key click or depress or release.\nOn Wayland requires write access to /dev/uinput."),
|
||||
halign=Gtk.Align.CENTER,
|
||||
justify=Gtk.Justification.CENTER,
|
||||
)
|
||||
self.widgets[self.label] = (0, 0, 5, 1)
|
||||
self.del_btns = []
|
||||
|
|
@ -72,6 +73,7 @@ class KeyPressUI(ActionUI):
|
|||
def _create_field(self):
|
||||
field_entry = CompletionEntry(self.KEY_NAMES, halign=Gtk.Align.CENTER, valign=Gtk.Align.END, hexpand=True)
|
||||
field_entry.connect(GtkSignal.CHANGED.value, self._on_update)
|
||||
field_entry.set_size_request(250, -1)
|
||||
self.fields.append(field_entry)
|
||||
self.widgets[field_entry] = (len(self.fields) - 1, 1, 1, 1)
|
||||
return field_entry
|
||||
|
|
@ -119,7 +121,6 @@ class KeyPressUI(ActionUI):
|
|||
field_entry = self.fields[i]
|
||||
with self.ignore_changes():
|
||||
field_entry.set_text(component.key_names[i])
|
||||
field_entry.set_size_request(int(0.3 * self.panel.get_toplevel().get_size()[0]), 0)
|
||||
field_entry.show_all()
|
||||
self.del_btns[i].show()
|
||||
for i in range(n, len(self.fields)):
|
||||
|
|
@ -149,7 +150,9 @@ class MouseScrollUI(ActionUI):
|
|||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(
|
||||
label=_("Simulate a mouse scroll.\nOn Wayland requires write access to /dev/uinput."), halign=Gtk.Align.CENTER
|
||||
label=_("Simulate a mouse scroll.\nOn Wayland requires write access to /dev/uinput."),
|
||||
halign=Gtk.Align.CENTER,
|
||||
justify=Gtk.Justification.CENTER,
|
||||
)
|
||||
self.widgets[self.label] = (0, 0, 4, 1)
|
||||
self.label_x = Gtk.Label(label="x", halign=Gtk.Align.END, valign=Gtk.Align.END, hexpand=True)
|
||||
|
|
@ -205,11 +208,15 @@ class MouseClickUI(ActionUI):
|
|||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(
|
||||
label=_("Simulate a mouse click.\nOn Wayland requires write access to /dev/uinput."), halign=Gtk.Align.CENTER
|
||||
label=_("Simulate a mouse click.\nOn Wayland requires write access to /dev/uinput."),
|
||||
halign=Gtk.Align.CENTER,
|
||||
justify=Gtk.Justification.CENTER,
|
||||
)
|
||||
self.widgets[self.label] = (0, 0, 4, 1)
|
||||
self.label_b = Gtk.Label(label=_("Button"), halign=Gtk.Align.END, valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label_c = Gtk.Label(label=_("Count and Action"), halign=Gtk.Align.END, valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label_c = Gtk.Label(
|
||||
label=_("Action (and Count, if click)"), halign=Gtk.Align.END, valign=Gtk.Align.CENTER, hexpand=True
|
||||
)
|
||||
self.field_b = CompletionEntry(self.BUTTONS)
|
||||
self.field_c = Gtk.SpinButton.new_with_range(self.MIN_VALUE, self.MAX_VALUE, 1)
|
||||
self.field_d = CompletionEntry(self.ACTIONS)
|
||||
|
|
@ -222,8 +229,8 @@ class MouseClickUI(ActionUI):
|
|||
self.widgets[self.label_b] = (0, 1, 1, 1)
|
||||
self.widgets[self.field_b] = (1, 1, 1, 1)
|
||||
self.widgets[self.label_c] = (2, 1, 1, 1)
|
||||
self.widgets[self.field_c] = (3, 1, 1, 1)
|
||||
self.widgets[self.field_d] = (4, 1, 1, 1)
|
||||
self.widgets[self.field_c] = (4, 1, 1, 1)
|
||||
self.widgets[self.field_d] = (3, 1, 1, 1)
|
||||
|
||||
def show(self, component, editable=True):
|
||||
super().show(component, editable)
|
||||
|
|
@ -258,7 +265,9 @@ class ExecuteUI(ActionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(label=_("Execute a command with arguments."), halign=Gtk.Align.CENTER)
|
||||
self.label = Gtk.Label(
|
||||
label=_("Execute a command with arguments."), halign=Gtk.Align.CENTER, justify=Gtk.Justification.CENTER
|
||||
)
|
||||
self.widgets[self.label] = (0, 0, 5, 1)
|
||||
self.fields = []
|
||||
self.add_btn = Gtk.Button(label=_("Add argument"), halign=Gtk.Align.CENTER, valign=Gtk.Align.END, hexpand=True)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ProcessUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("X11 active process. For use in X11 only."))
|
||||
self.widgets[self.label] = (0, 0, 1, 1)
|
||||
self.field = Gtk.Entry(halign=Gtk.Align.CENTER, valign=Gtk.Align.CENTER, hexpand=True)
|
||||
|
|
@ -78,7 +78,7 @@ class MouseProcessUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("X11 mouse process. For use in X11 only."))
|
||||
self.widgets[self.label] = (0, 0, 1, 1)
|
||||
self.field = Gtk.Entry(halign=Gtk.Align.CENTER, valign=Gtk.Align.CENTER, hexpand=True)
|
||||
|
|
@ -119,7 +119,7 @@ class FeatureUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("Feature name of notification triggering rule processing."))
|
||||
self.widgets[self.label] = (0, 0, 1, 1)
|
||||
self.field = Gtk.ComboBoxText.new_with_entry()
|
||||
|
|
@ -165,7 +165,7 @@ class ReportUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("Report number of notification triggering rule processing."))
|
||||
self.widgets[self.label] = (0, 0, 1, 1)
|
||||
self.field = Gtk.SpinButton.new_with_range(self.MIN_VALUE, self.MAX_VALUE, 1)
|
||||
|
|
@ -197,7 +197,7 @@ class ModifiersUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("Active keyboard modifiers. Not always available in Wayland."))
|
||||
self.widgets[self.label] = (0, 0, 5, 1)
|
||||
self.labels = {}
|
||||
|
|
@ -235,7 +235,7 @@ class KeyUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(
|
||||
_(
|
||||
"Diverted key or button depressed or released.\n"
|
||||
|
|
@ -287,7 +287,7 @@ class KeyIsDownUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(
|
||||
_(
|
||||
"Diverted key or button is currently down.\n"
|
||||
|
|
@ -327,7 +327,7 @@ class TestUI(ConditionUI):
|
|||
|
||||
def create_widgets(self):
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("Test condition on notification triggering rule processing."))
|
||||
self.widgets[self.label] = (0, 0, 4, 1)
|
||||
lbl = Gtk.Label(label=_("Test"), halign=Gtk.Align.CENTER, valign=Gtk.Align.END, hexpand=False, vexpand=False)
|
||||
|
|
@ -433,7 +433,7 @@ class TestBytesUI(ConditionUI):
|
|||
self.fields = {}
|
||||
self.field_labels = {}
|
||||
self.widgets = {}
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True)
|
||||
self.label = Gtk.Label(valign=Gtk.Align.CENTER, hexpand=True, justify=Gtk.Justification.CENTER)
|
||||
self.label.set_text(_("Bit or range test on bytes in notification message triggering rule processing."))
|
||||
self.widgets[self.label] = (0, 0, 5, 1)
|
||||
col = 0
|
||||
|
|
@ -534,6 +534,7 @@ class MouseGestureUI(ConditionUI):
|
|||
self.label = Gtk.Label(
|
||||
label=_("Mouse gesture with optional initiating button followed by zero or more mouse movements."),
|
||||
halign=Gtk.Align.CENTER,
|
||||
justify=Gtk.Justification.CENTER,
|
||||
)
|
||||
self.widgets[self.label] = (0, 0, 5, 1)
|
||||
self.del_btns = []
|
||||
|
|
@ -592,7 +593,6 @@ class MouseGestureUI(ConditionUI):
|
|||
field = self.fields[i]
|
||||
with self.ignore_changes():
|
||||
field.get_child().set_text(component.movements[i])
|
||||
field.set_size_request(int(0.3 * self.panel.get_toplevel().get_size()[0]), 0)
|
||||
field.show_all()
|
||||
self.del_btns[i].show()
|
||||
for i in range(n, len(self.fields)):
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.1.14
|
||||
1.1.16
|
||||
|
|
|
|||
16
mkdocs.yml
16
mkdocs.yml
|
|
@ -3,22 +3,22 @@ site_description: Linux Device Manager for Logitech Unifying Receivers and Devic
|
|||
site_author: pwr-Solaar
|
||||
repo_url: https://github.com/pwr-Solaar/Solaar
|
||||
repo_name: Solaar
|
||||
logo: img/favicon.png
|
||||
theme:
|
||||
name: readthedocs
|
||||
docs_dir: docs
|
||||
nav:
|
||||
- Solaar: index.md
|
||||
- Usage: usage.md
|
||||
- Capabilities: capabilities.md
|
||||
- Debian: debian.md
|
||||
- Devices: devices.md
|
||||
- Features: features.md
|
||||
- Translation: i18n.md
|
||||
- Implementation: implementation.md
|
||||
- Issues: issues.md
|
||||
- Rules: rules.md
|
||||
- Installation: installation.md
|
||||
- Uninstallation: uninstallation.md
|
||||
- Rules: rules.md
|
||||
- Usage: usage.md
|
||||
- Translation: i18n.md
|
||||
- Features: features.md
|
||||
- Devices: devices.md
|
||||
- Implementation: implementation.md
|
||||
- Debian: debian.md
|
||||
|
||||
plugins:
|
||||
- search
|
||||
|
|
|
|||
1033
po/solaar.pot
1033
po/solaar.pot
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
repo=pwr-Solaar/Solaar
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
</screenshots>
|
||||
|
||||
<releases>
|
||||
<release version="1.1.16" date="2025-10-23"/>
|
||||
<release version="1.1.14" date="2025-01-01"/>
|
||||
<release version="1.1.13" date="2024-05-11"/>
|
||||
<release version="1.1.12" date="2024-04-27"/>
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ def test_create_device(device_info, responses, expected_success):
|
|||
with pytest.raises(PermissionError):
|
||||
device.create_device(low_level_mock, device_info)
|
||||
elif not expected_success:
|
||||
with pytest.raises(TypeError):
|
||||
with pytest.raises(Exception): # noqa: B017
|
||||
device.create_device(low_level_mock, device_info)
|
||||
else:
|
||||
test_device = device.create_device(low_level_mock, device_info)
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ def test_KeysArrayV4__getitem(device, count, index, cid, task_id, flags, pos, gr
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"key, index", [(special_keys.CONTROL.Volume_Up, 2), (special_keys.CONTROL.Mute, 4), (special_keys.CONTROL.Next, None)]
|
||||
"key, index", [(special_keys.CONTROL.Volume_Up_old, 2), (special_keys.CONTROL.Mute, 4), (special_keys.CONTROL.Next, None)]
|
||||
)
|
||||
def test_KeysArrayV4_index(key, index):
|
||||
keysarray = hidpp20.KeysArrayV4(device_standard, 7)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
find . -type f -name '*.py[co]' -delete
|
||||
find . -type d -name '__pycache__' -delete
|
||||
|
||||
/bin/rm --force po/*~
|
||||
/bin/rm --force --recursive share/locale/
|
||||
rm --force po/*~
|
||||
rm --force --recursive share/locale/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
#!/usr/bin/env bash
|
||||
# Helper to build a minimal macOS .app wrapper for Solaar.
|
||||
set -euo pipefail
|
||||
|
||||
APP_ROOT=${1:-/Applications/Solaar.app}
|
||||
SOLAAR_PATH=${SOLAAR_PATH:-solaar}
|
||||
SOLAAR_RESOLVED_PATH=$(command -v "${SOLAAR_PATH}" 2>/dev/null || echo "")
|
||||
if [ -z "${SOLAAR_RESOLVED_PATH}" ]; then
|
||||
echo "Error: '${SOLAAR_PATH}' not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
ICON_SOURCE=${ICON_SOURCE:-share/solaar/icons/solaar.svg}
|
||||
|
||||
case "${APP_ROOT}" in
|
||||
""|"/"|".")
|
||||
echo "Error: Refusing to create app bundle at unsafe location: \"${APP_ROOT}\"" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Creating Solaar app bundle at ${APP_ROOT}"
|
||||
rm -rf "${APP_ROOT}"
|
||||
|
||||
APP_CONTENTS="${APP_ROOT}/Contents"
|
||||
MACOS_DIR="${APP_CONTENTS}/MacOS"
|
||||
RESOURCES_DIR="${APP_CONTENTS}/Resources"
|
||||
|
||||
mkdir -p "${MACOS_DIR}" "${RESOURCES_DIR}"
|
||||
|
||||
WRAPPER="${MACOS_DIR}/solaar-wrapper"
|
||||
cat > "${WRAPPER}" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# When launched via 'Solaar.app', macOS applies .app bundle restrictions
|
||||
# that may prevent GTK from creating a tray icon properly.
|
||||
# Workaround: Launch solaar in a detached background process
|
||||
|
||||
# NOTE: macOS Python always uses Python.app which shows a Dock icon
|
||||
# LSUIElement=true in Info.plist would have hidden it, but Python.app has its own Info.plist
|
||||
# that overrides ours. This is a limitation of Python on macOS.
|
||||
|
||||
if [[ "\${SOLAAR_RELAUNCHED:-}" != "1" ]]; then
|
||||
# First invocation from .app bundle - relaunch detached
|
||||
export SOLAAR_RELAUNCHED=1
|
||||
nohup "\$0" "\$@" >/dev/null 2>&1 &
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Second invocation - now detached, exec solaar normally
|
||||
exec "${SOLAAR_RESOLVED_PATH}" "\$@"
|
||||
EOF
|
||||
chmod +x "${WRAPPER}"
|
||||
|
||||
HAVE_ICON=0
|
||||
if command -v sips >/dev/null 2>&1 && command -v iconutil >/dev/null 2>&1 && [[ -f "${ICON_SOURCE}" ]]; then
|
||||
TMP_DIR=$(mktemp -d /tmp/solaar-icon.XXXXXX)
|
||||
TMP_ICONSET="${TMP_DIR}/solaar.iconset"
|
||||
mkdir -p "${TMP_ICONSET}"
|
||||
trap 'rm -rf "${TMP_DIR}"' EXIT
|
||||
for SIZE in 16 32 64 128 256 512; do
|
||||
sips -s format png -z "${SIZE}" "${SIZE}" "${ICON_SOURCE}" --out "${TMP_ICONSET}/icon_${SIZE}x${SIZE}.png" >/dev/null
|
||||
DOUBLE=$((SIZE * 2))
|
||||
sips -s format png -z "${DOUBLE}" "${DOUBLE}" "${ICON_SOURCE}" --out "${TMP_ICONSET}/icon_${SIZE}x${SIZE}@2x.png" >/dev/null
|
||||
done
|
||||
if iconutil -c icns "${TMP_ICONSET}" -o "${RESOURCES_DIR}/solaar.icns" >/dev/null 2>&1; then
|
||||
HAVE_ICON=1
|
||||
echo "Added icon from ${ICON_SOURCE}"
|
||||
else
|
||||
echo "Warning: Failed to create solaar.icns – continuing without custom icon" >&2
|
||||
fi
|
||||
rm -rf "${TMP_DIR}"
|
||||
trap - EXIT
|
||||
else
|
||||
echo "Skipping icon generation (requires sips, iconutil, and ${ICON_SOURCE})"
|
||||
fi
|
||||
|
||||
{
|
||||
cat <<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>solaar-wrapper</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.github.pwr-solaar.solaar</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Solaar</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>11.0</string>
|
||||
<key>NSInputMonitoringUsageDescription</key>
|
||||
<string>Solaar needs to access input devices to configure and monitor your Logitech keyboards, mice, and other peripherals.</string>
|
||||
<key>LSUIElement</key>
|
||||
<false/>
|
||||
EOF
|
||||
if [[ ${HAVE_ICON} -eq 1 ]]; then
|
||||
cat <<'EOF'
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>solaar.icns</string>
|
||||
EOF
|
||||
fi
|
||||
cat <<'EOF'
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
} > "${APP_CONTENTS}/Info.plist"
|
||||
|
||||
echo "Solaar app bundle created at ${APP_ROOT}"
|
||||
echo ""
|
||||
echo "To install the LaunchAgent for automatic startup and keep-alive execute:"
|
||||
echo " bash tools/create-macos-launchagent.sh"
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
#!/usr/bin/env bash
|
||||
# Helper to install a LaunchAgent for Solaar to keep it running in the background.
|
||||
set -euo pipefail
|
||||
|
||||
SOLAAR_PATH=${SOLAAR_PATH:-solaar}
|
||||
SOLAAR_RESOLVED_PATH=$(command -v "${SOLAAR_PATH}" 2>/dev/null || echo "")
|
||||
if [ -z "${SOLAAR_RESOLVED_PATH}" ]; then
|
||||
echo "Error: '${SOLAAR_PATH}' not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LAUNCH_AGENT_DIR="${HOME}/Library/LaunchAgents"
|
||||
LAUNCH_AGENT_PLIST="${LAUNCH_AGENT_DIR}/io.github.pwr-solaar.solaar.plist"
|
||||
|
||||
mkdir -p "${LAUNCH_AGENT_DIR}"
|
||||
|
||||
echo "Creating LaunchAgent to keep Solaar running..."
|
||||
|
||||
# Unload if already loaded (suppress errors)
|
||||
launchctl unload "${LAUNCH_AGENT_PLIST}" 2>/dev/null || true
|
||||
|
||||
cat > "${LAUNCH_AGENT_PLIST}" <<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>io.github.pwr-solaar.solaar</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>${SOLAAR_RESOLVED_PATH}</string>
|
||||
<string>--window=hide</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>StandardOutPath</key>
|
||||
<string>${HOME}/Library/Logs/solaar.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>${HOME}/Library/Logs/solaar.error.log</string>
|
||||
<key>ProcessType</key>
|
||||
<string>Background</string>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
launchctl load "${LAUNCH_AGENT_PLIST}"
|
||||
|
||||
echo "LaunchAgent created at ${LAUNCH_AGENT_PLIST}"
|
||||
echo ""
|
||||
echo "To disable automatic startup:"
|
||||
echo " launchctl unload \"${LAUNCH_AGENT_PLIST}\""
|
||||
echo ""
|
||||
echo "To re-enable automatic startup:"
|
||||
echo " launchctl load \"${LAUNCH_AGENT_PLIST}\""
|
||||
echo ""
|
||||
echo "To start Solaar:"
|
||||
echo " launchctl start io.github.pwr-solaar.solaar"
|
||||
echo ""
|
||||
echo "To stop Solaar:"
|
||||
echo " launchctl stop io.github.pwr-solaar.solaar"
|
||||
echo ""
|
||||
echo "Logs will be written to:"
|
||||
echo " ${HOME}/Library/Logs/solaar.log"
|
||||
echo " ${HOME}/Library/Logs/solaar.error.log"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ while read po_file; do
|
|||
language="$(basename "$po_file")"
|
||||
language="${language%.po}"
|
||||
target="$PWD/share/locale/$language/LC_MESSAGES/solaar.mo"
|
||||
/bin/mkdir --parents "$(dirname "$target")"
|
||||
/usr/bin/msgfmt \
|
||||
mkdir --parents "$(dirname "$target")"
|
||||
msgfmt \
|
||||
--check \
|
||||
--output-file="$target" \
|
||||
"$po_file"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ cd "$(readlink -f "$(dirname "$0")/..")"
|
|||
VERSION=$(python setup.py --version)
|
||||
DOMAIN=$(python setup.py --name)
|
||||
|
||||
SOURCE_FILES=$(/bin/mktemp --tmpdir $DOMAIN-po-update-XXXXXX)
|
||||
SOURCE_FILES=$(mktemp --tmpdir $DOMAIN-po-update-XXXXXX)
|
||||
find "lib" -name '*.py' >"$SOURCE_FILES"
|
||||
|
||||
POT_DIR="$PWD/po"
|
||||
|
|
@ -21,7 +21,7 @@ test -d "$POT_DIR"
|
|||
|
||||
POT_FILE="$POT_DIR/$DOMAIN.pot"
|
||||
|
||||
/usr/bin/xgettext \
|
||||
xgettext \
|
||||
--package-name "$DOMAIN" \
|
||||
--package-version "$VERSION" \
|
||||
--default-domain="$L_NAME" \
|
||||
|
|
@ -30,7 +30,7 @@ POT_FILE="$POT_DIR/$DOMAIN.pot"
|
|||
--add-comments=I18N \
|
||||
--output="$POT_FILE"
|
||||
|
||||
/bin/sed --in-place --expression="s/charset=CHARSET/charset=UTF-8/" "$POT_FILE"
|
||||
sed --in-place --expression="s/charset=CHARSET/charset=UTF-8/" "$POT_FILE"
|
||||
|
||||
|
||||
unfmt() {
|
||||
|
|
@ -39,7 +39,7 @@ unfmt() {
|
|||
SOURCE="/usr/share/locale-langpack/$LL_CC/LC_MESSAGES/$1.mo"
|
||||
fi
|
||||
local TARGET="$(mktemp --tmpdir $1-$LL_CC-XXXXXX.po)"
|
||||
/usr/bin/msgunfmt \
|
||||
msgunfmt \
|
||||
--no-escape --indent \
|
||||
--output-file="$TARGET" \
|
||||
"$SOURCE"
|
||||
|
|
@ -50,12 +50,12 @@ update_po() {
|
|||
local LL_CC="$1"
|
||||
local PO_FILE="$POT_DIR/$LL_CC.po"
|
||||
|
||||
test -r "$PO_FILE" || /usr/bin/msginit \
|
||||
test -r "$PO_FILE" || msginit \
|
||||
--no-translator --locale="$LL_CC" \
|
||||
--input="$POT_FILE" \
|
||||
--output-file="$PO_FILE"
|
||||
|
||||
/usr/bin/msgmerge \
|
||||
msgmerge \
|
||||
--update --no-fuzzy-matching \
|
||||
--no-escape --indent --add-location --sort-by-file \
|
||||
--lang="$LL_CC" \
|
||||
|
|
@ -63,7 +63,7 @@ update_po() {
|
|||
--compendium="$(unfmt gtk30-properties)" \
|
||||
"$PO_FILE" "$POT_FILE"
|
||||
|
||||
# /bin/sed --in-place --expression="s/Language: \\\\n/Language: $L_NAME\\\\n/" "$PO_FILE"
|
||||
# sed --in-place --expression="s/Language: \\\\n/Language: $L_NAME\\\\n/" "$PO_FILE"
|
||||
echo "Updated $PO_FILE"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if test -z "$1"; then
|
||||
echo "Use: $0 <device number 1..6> [<receiver device>]"
|
||||
|
|
|
|||
Loading…
Reference in New Issue