Add project infrastructure and core application files
Add .gitignore, GitLab CI pipeline with test/lint/build/release stages, project documentation (README, LICENSE, CHANGELOG, CONTRIBUTING, SECURITY), PyInstaller packaging configuration with icon and version info, Python project configuration with dependencies, and complete application source including battery provider, device discovery, settings management, UI components, startup control, and comprehensive test suite
This commit is contained in:
@@ -1,93 +1,101 @@
|
||||
# NexaLogi
|
||||
# Logitech Battery Widget
|
||||
|
||||
An open-source Windows tray widget that displays battery information for connected Logitech mice,
|
||||
keyboards, and headsets. It discovers devices locally through HID and attempts a read-only Logitech
|
||||
HID++ battery query. Multiple devices are shown together. If Windows or a device does not expose a
|
||||
battery value, the widget says so instead of guessing.
|
||||
|
||||
> **Screenshot placeholder:** A project screenshot will be added under `docs/screenshot.png` after
|
||||
> the first signed release build is visually verified on Windows 11.
|
||||
|
||||
## Getting started
|
||||
## Trust and privacy
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
- No network access, telemetry, analytics, updater, advertising, or runtime downloads.
|
||||
- No administrator rights or UAC prompt.
|
||||
- No hidden startup entry. "Start with Windows" changes only the current user's registry after an
|
||||
explicit click, and can be disabled from the same menu.
|
||||
- The complete source and reproducible GitLab CI recipe are public so the behavior can be audited.
|
||||
- Settings and logs stay in the documented per-user Windows folders.
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
See [SECURITY.md](SECURITY.md) for the full security model.
|
||||
|
||||
## Add your files
|
||||
## End-user installation
|
||||
|
||||
* [Create](https://docs.gitlab.com/user/project/repository/web_editor/#create-a-file) or [upload](https://docs.gitlab.com/user/project/repository/web_editor/#upload-a-file) files
|
||||
* [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
|
||||
1. Download `LogitechBatteryWidget.exe` from a GitLab release or build artifact.
|
||||
2. Optionally verify its SHA-256 value against `LogitechBatteryWidget.exe.sha256`.
|
||||
3. Run the EXE. It is portable and does not install a service or driver.
|
||||
4. Use the tray menu to refresh, hide the widget, change settings, or explicitly enable startup.
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://gitlab.nesterovic.cc/nessi/NexaLogi.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
The executable is produced by PyInstaller. Some antivirus products heuristically flag unsigned
|
||||
PyInstaller one-file programs. This can be a false positive; verify the checksum, inspect the CI
|
||||
job and source, or submit the file to VirusTotal. A detection should still be investigated rather
|
||||
than automatically ignored.
|
||||
|
||||
## Local development
|
||||
|
||||
Requires Python 3.12+.
|
||||
|
||||
```powershell
|
||||
py -3.12 -m venv .venv
|
||||
.venv\Scripts\Activate.ps1
|
||||
python -m pip install -r requirements.txt
|
||||
python -m logitech_battery_widget.main
|
||||
pytest
|
||||
ruff check .
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
On Linux and macOS the UI starts with clearly named demo devices. This makes UI development
|
||||
possible without pretending that real Logitech hardware was detected.
|
||||
|
||||
* [Set up project integrations](http://gitlab.nesterovic.cc/nessi/NexaLogi/-/settings/integrations)
|
||||
## Build
|
||||
|
||||
## Collaborate with your team
|
||||
On Windows:
|
||||
|
||||
* [Invite team members and collaborators](https://docs.gitlab.com/user/project/members/)
|
||||
* [Create a new merge request](https://docs.gitlab.com/user/project/merge_requests/creating_merge_requests/)
|
||||
* [Automatically close issues from merge requests](https://docs.gitlab.com/user/project/issues/managing_issues/#closing-issues-automatically)
|
||||
* [Enable merge request approvals](https://docs.gitlab.com/user/project/merge_requests/approvals/)
|
||||
* [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
|
||||
```powershell
|
||||
python -m pip install -r requirements.txt
|
||||
pytest
|
||||
ruff check .
|
||||
pyinstaller --clean --noconfirm packaging/pyinstaller.spec
|
||||
Get-FileHash dist/LogitechBatteryWidget.exe -Algorithm SHA256
|
||||
```
|
||||
|
||||
## Test and Deploy
|
||||
The result is `dist/LogitechBatteryWidget.exe`, a console-free, UPX-disabled one-file executable.
|
||||
GitLab CI executes the same dependency installation, tests, lint, and PyInstaller command on a
|
||||
Windows runner and publishes the EXE plus checksum. Builds fail when tests fail.
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
## Reproducible builds
|
||||
|
||||
* [Get started with GitLab CI/CD](https://docs.gitlab.com/ci/quick_start/)
|
||||
* [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/user/application_security/sast/)
|
||||
* [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/topics/autodevops/requirements/)
|
||||
* [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/user/clusters/agent/)
|
||||
* [Set up protected environments](https://docs.gitlab.com/ci/environments/protected_environments/)
|
||||
1. Check out the same commit on a clean Windows machine or isolated Windows runner.
|
||||
2. Install Python 3.12 and the exact packages from `requirements.txt`.
|
||||
3. Run the commands in **Build**.
|
||||
4. Compare the SHA-256 result. Exact bytes also depend on the same Python patch version, Windows
|
||||
SDK/runtime, and PyInstaller version; the GitLab job log records that environment.
|
||||
|
||||
***
|
||||
No file is downloaded by the application itself. Dependency retrieval happens only while preparing
|
||||
the build environment.
|
||||
|
||||
# Editing this README
|
||||
## Configuration
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
`%APPDATA%\LogitechBatteryWidget\config.json` contains:
|
||||
|
||||
## Suggestions for a good README
|
||||
| Key | Type | Meaning |
|
||||
| --- | --- | --- |
|
||||
| `theme` | string | `system`, `light`, or `dark` |
|
||||
| `always_on_top` | boolean | Keep the widget above normal windows |
|
||||
| `window_x`, `window_y` | integer/null | Last widget position |
|
||||
| `refresh_interval_seconds` | integer | Refresh period, clamped to 15-3600 |
|
||||
| `log_level` | string | `DEBUG`, `INFO`, `WARNING`, `ERROR`, or `CRITICAL` |
|
||||
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
Logs rotate at `%LOCALAPPDATA%\LogitechBatteryWidget\logs\app.log` (1 MB, three backups).
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
## Device compatibility
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
Logitech exposes different protocols across receivers, Bluetooth devices, and product generations.
|
||||
The widget supports HID++ battery features `0x1000` and `0x1004`. A detected device can therefore
|
||||
appear with `N/A` when its interface, firmware, Bluetooth stack, or receiver does not expose either
|
||||
feature. Contributions with tested protocol captures are welcome; do not include serial numbers.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
MIT. This project is independent and is not affiliated with or endorsed by Logitech. Logitech is a
|
||||
trademark of its respective owner.
|
||||
|
||||
Reference in New Issue
Block a user