mirror of
https://github.com/Steve-Tech/YAFI.git
synced 2026-04-19 16:50:36 +00:00
Add support for pip again
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -172,3 +172,6 @@ cython_debug/
|
|||||||
|
|
||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
|
|
||||||
|
# Flatpak builder
|
||||||
|
.flatpak-builder/
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
include yafi/ui/*.ui
|
include yafi/ui/*.ui
|
||||||
|
include yafi/yafi.gresource
|
||||||
|
|||||||
47
README.md
47
README.md
@@ -3,7 +3,40 @@
|
|||||||
YAFI is another GUI for the Framework Laptop Embedded Controller.
|
YAFI is another GUI for the Framework Laptop Embedded Controller.
|
||||||
It is written in Python with a GTK4 Adwaita theme, and uses the `CrOS_EC_Python` library to communicate with the EC.
|
It is written in Python with a GTK4 Adwaita theme, and uses the `CrOS_EC_Python` library to communicate with the EC.
|
||||||
|
|
||||||
## Features
|
It has support for fan control, temperature monitoring, LED control, and battery limiting.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### udev Rules (MUST READ)
|
||||||
|
|
||||||
|
To allow YAFI to communicate with the EC, you need to copy the [`60-cros_ec_python.rules`](https://github.com/Steve-Tech/YAFI/blob/main/60-cros_ec_python.rules) file to `/etc/udev/rules.d/` and reload the rules with `sudo udevadm control --reload-rules && sudo udevadm trigger`.
|
||||||
|
|
||||||
|
### Flatpak
|
||||||
|
|
||||||
|
Build and install the Flatpak package with `flatpak-builder --install --user build au.stevetech.yafi.json`.
|
||||||
|
|
||||||
|
You can also create a flatpak bundle with `flatpak-builder --repo=repo build au.stevetech.yafi.json` and install it with `flatpak install --user repo au.stevetech.yafi.flatpak`.
|
||||||
|
|
||||||
|
### Pip
|
||||||
|
|
||||||
|
#### System Dependencies
|
||||||
|
|
||||||
|
The following system dependencies are required for `PyGObject`:
|
||||||
|
|
||||||
|
- `python3-dev`
|
||||||
|
- `libcairo2-dev`
|
||||||
|
- `libgirepository-2.0-dev`
|
||||||
|
- `gir1.2-adw-1`
|
||||||
|
|
||||||
|
There's probably more, but I happened to have them installed.
|
||||||
|
|
||||||
|
#### Install
|
||||||
|
|
||||||
|
Install the package with `pip install git+https://github.com/Steve-Tech/YAFI.git`.
|
||||||
|
|
||||||
|
Pipx is also supported.
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
### Fan Control and Temperature Monitoring
|
### Fan Control and Temperature Monitoring
|
||||||
|
|
||||||
@@ -24,15 +57,3 @@ It is written in Python with a GTK4 Adwaita theme, and uses the `CrOS_EC_Python`
|
|||||||
### Hardware Info
|
### Hardware Info
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### udev Rules (MUST READ)
|
|
||||||
|
|
||||||
To allow YAFI to communicate with the EC, you need to copy the `60-cros_ec_python.rules` file to `/etc/udev/rules.d/` and reload the rules with `sudo udevadm control --reload-rules && sudo udevadm trigger`.
|
|
||||||
|
|
||||||
### Flatpak
|
|
||||||
|
|
||||||
Build and install the Flatpak package with `flatpak-builder --install --user build au.stevetech.yafi.json`.
|
|
||||||
|
|
||||||
You can also create a flatpak bundle with `flatpak-builder --repo=repo build au.stevetech.yafi.json` and install it with `flatpak install --user repo au.stevetech.yafi.flatpak`.
|
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ classifiers = [
|
|||||||
"Development Status :: 2 - Pre-Alpha",
|
"Development Status :: 2 - Pre-Alpha",
|
||||||
"Intended Audience :: End Users/Desktop",
|
"Intended Audience :: End Users/Desktop",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
|
||||||
"Operating System :: POSIX :: Linux",
|
"Operating System :: POSIX :: Linux",
|
||||||
"Topic :: System :: Hardware",
|
"Topic :: System :: Hardware",
|
||||||
]
|
]
|
||||||
|
license = "GPL-2.0-or-later"
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
lpc = ["portio"]
|
lpc = ["portio"]
|
||||||
@@ -33,3 +33,6 @@ yafi = "yafi:main"
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = ["setuptools>=61.0"]
|
requires = ["setuptools>=61.0"]
|
||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = ["yafi"]
|
||||||
|
|||||||
@@ -1 +1,9 @@
|
|||||||
from . import main
|
import os
|
||||||
|
|
||||||
|
# Register resources if not running in Flatpak
|
||||||
|
if not os.environ.get('FLATPAK_ID'):
|
||||||
|
from gi.repository import Gio
|
||||||
|
resource = Gio.Resource.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'yafi.gresource'))
|
||||||
|
resource._register()
|
||||||
|
|
||||||
|
from .main import main
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from . import main
|
|
||||||
|
|
||||||
main.main()
|
|
||||||
@@ -62,6 +62,8 @@ class HardwarePage(Gtk.Box):
|
|||||||
else:
|
else:
|
||||||
self.hw_fp_pwr.set_visible(False)
|
self.hw_fp_pwr.set_visible(False)
|
||||||
|
|
||||||
|
self._update_hardware(app)
|
||||||
|
|
||||||
# Schedule _update_hardware to run every second
|
# Schedule _update_hardware to run every second
|
||||||
GLib.timeout_add_seconds(1, self._update_hardware, app)
|
GLib.timeout_add_seconds(1, self._update_hardware, app)
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ from .hardware import HardwarePage
|
|||||||
|
|
||||||
from cros_ec_python import get_cros_ec
|
from cros_ec_python import get_cros_ec
|
||||||
|
|
||||||
|
|
||||||
class YafiApplication(Adw.Application):
|
class YafiApplication(Adw.Application):
|
||||||
"""The main application singleton class."""
|
"""The main application singleton class."""
|
||||||
|
|
||||||
@@ -134,7 +135,7 @@ class YafiApplication(Adw.Application):
|
|||||||
dialog.present(self.win)
|
dialog.present(self.win)
|
||||||
|
|
||||||
|
|
||||||
def main(version):
|
def main():
|
||||||
"""The application's entry point."""
|
"""The application's entry point."""
|
||||||
app = YafiApplication()
|
app = YafiApplication()
|
||||||
return app.run(sys.argv)
|
return app.run(sys.argv)
|
||||||
|
|||||||
BIN
yafi/yafi.gresource
Normal file
BIN
yafi/yafi.gresource
Normal file
Binary file not shown.
@@ -26,7 +26,7 @@ import signal
|
|||||||
import locale
|
import locale
|
||||||
import gettext
|
import gettext
|
||||||
|
|
||||||
VERSION = '@VERSION@'
|
# VERSION = '@VERSION@'
|
||||||
pkgdatadir = '@pkgdatadir@'
|
pkgdatadir = '@pkgdatadir@'
|
||||||
localedir = '@localedir@'
|
localedir = '@localedir@'
|
||||||
|
|
||||||
@@ -44,4 +44,4 @@ if __name__ == '__main__':
|
|||||||
resource._register()
|
resource._register()
|
||||||
|
|
||||||
from yafi import main
|
from yafi import main
|
||||||
sys.exit(main.main(VERSION))
|
sys.exit(main.main())
|
||||||
|
|||||||
Reference in New Issue
Block a user