Show HN: Legionlinuxtui – 在终端控制联想拯救者笔记本电脑
Show HN: Legionlinuxtui – Control Lenovo legion laptops in the terminal

原始链接: https://github.com/nooneknowspeter/legionlinuxtui

**LegionLinuxTUI** 是一款基于终端的界面,旨在通过 Lenovo Legion Linux 驱动程序控制联想拯救者(Lenovo Legion)笔记本电脑。它提供实时传感器监控(100 毫秒刷新率),并允许用户切换电源模式及其他系统设置。 **主要要求:** * **权限:** 该应用程序需要 `sudo` 权限以与驱动程序和 sysfs 进行交互。 * **依赖:** 需要 Go 1.24.4 或更高版本。 **安装(Nix 用户):** 该工具可通过 NUR 仓库获取。您可以将其添加到 `flake.nix` 的输入项中(使用 `github:nooneknowspeter/nurpkgs`)。用户可以选择稳定版 `legionlinuxtui` 软件包,或滚动更新版 `legionlinuxtui-git`。它可以集成到系统环境软件包或 Home-Manager 配置中。 **开发与贡献:** 该代码库包含用于快速执行命令的 Makefile、开发 shell 环境以及对 `direnv` 的 `.envrc` 支持。欢迎开发者贡献代码;请在提交拉取请求(Pull Request)前使用 `make lint` 进行检查。鼓励提交错误报告和功能建议,以帮助改进稳定性和功能。

抱歉。
相关文章

原文

A terminal user interface for controlling Lenovo Legion laptops.

It utilizes the Lenovo Legion Linux Drivers.

demo1

demo2

  • Sensor information display (100ms update)
  • Capability toggles; convservative mode, power mode, ...
  • Additional information

Users who have the NUR setup, you can install legionlinuxtui using:

nur.repos.nooneknowspeter.legionlinuxtui

You can install legionlinuxtui without having the NUR setup by using my NUR flake directly.

In your flake.nix, add the repo as an input:

inputs = {
    nooneknowspeter = {
      url = "github:nooneknowspeter/nurpkgs";
    };
}

Note

Either inputs.nooneknowspeter.packages.x86_64-linux.legionlinuxtui or inputs.nooneknowspeter.packages.x86_64-linux.legionlinuxtui-git can be used at a time.

legionlinuxtui-git builds from the latest commit from the main branch (rolling release) and legionlinux builds from each tagged version, so pick your poison.

Add the package to your system environment packages:

environment.systemPackages = with pkgs; [
    inputs.nooneknowspeter.packages.x86_64-linux.legionlinuxtui
]

or in Home-Manager packages:

home.packages = with pkgs; [
    inputs.nooneknowspeter.packages.x86_64-linux.legionlinuxtui
]

Note

Run the application with sudo privileges.

Note

Ensure Go >= 1.24.4 is installed.

A Nix flake development shell declaration is available in the repository.

Enter the shell using:

Note

A .envrc is also available in the repository for direnv users

Note

A Makefile is avaiable with quick commands.

Note

The application needs sudo privileges for I/O; interacting with the drivers, changing values in sysfs

Run the application:

or:

go build -o build/
sudo ./build/legionlinuxtui

Although this project is suited to my needs and wants; add my own features and fix my own issues, I will gladly appreciate and accept any PRs and issues that help the project.

Note

Use the make lint command in Makefile for linting.

CI/CD is available, PRs will get checked for any errors before merging.

Leaving issues; bugs and requested features are appreciated. They will help the project making it stable and practical as possible for others.

I keep track of the project tasks here as well as in the codebase; TODO:.

联系我们 contact @ memedata.com