{"id":21358658,"url":"https://github.com/alinuxperson/ideapad","last_synced_at":"2025-04-15T09:07:07.460Z","repository":{"id":44540230,"uuid":"443763532","full_name":"ALinuxPerson/ideapad","owner":"ALinuxPerson","description":"Utility library for some Lenovo IdeaPad laptops. Supports IdeaPad Intel and AMD Models (15IIL05 and 15ARE05)","archived":false,"fork":false,"pushed_at":"2022-02-09T03:52:10.000Z","size":210,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-22T05:23:07.886Z","etag":null,"topics":["acpi","battery-conservation","battery-conservation-mode","feature-rich","ideapad","lenovo","lenovo-ideapad","library","linux","rapid-charge","rapid-charge-mode","rust","system-performance","system-performance-mode","utilities","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ALinuxPerson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-02T12:44:28.000Z","updated_at":"2024-07-07T15:28:06.000Z","dependencies_parsed_at":"2022-09-04T00:40:18.809Z","dependency_job_id":null,"html_url":"https://github.com/ALinuxPerson/ideapad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fideapad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fideapad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fideapad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ALinuxPerson%2Fideapad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ALinuxPerson","download_url":"https://codeload.github.com/ALinuxPerson/ideapad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235164113,"owners_count":18945981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acpi","battery-conservation","battery-conservation-mode","feature-rich","ideapad","lenovo","lenovo-ideapad","library","linux","rapid-charge","rapid-charge-mode","rust","system-performance","system-performance-mode","utilities","wrapper"],"created_at":"2024-11-22T05:21:10.333Z","updated_at":"2025-01-22T18:27:32.021Z","avatar_url":"https://github.com/ALinuxPerson.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ideapad\nA Rust utility library for some Lenovo IdeaPad specific functionality.\n\n# A Fair Warning\nThis crate calls raw ACPI methods, which on the best case scenario when called on unsupported systems results in  \na `AE_NOT_FOUND` (acpi method not found) error, on the worst case you'll call an existing method, which might do\nanything to your system.\n\nThis crate tries to safeguard against this by providing a profiles feature (see below for more details), which enforces\ndifferent methods for different models, however you could easily circumvent this by providing an arbitrary profile.\n\nAll in all, don't use this crate on unsupported systems.\n\n# Supported Models\n\nThis crate has been tested on the Ideapad 15IIL05, although theoretically it should also work on the Ideapad AMD \nmodels.\n\n| **Model**       | **Product Names**              |\n|-----------------|--------------------------------|\n| Ideapad 15IIL05 | 81YK                           |\n| Ideapad AMD     | 81YQ (15ARE05), 81YM (14ARE05) |\n\n# Dependencies\n * [`acpi_call`](https://github.com/mkottman/acpi_call): For calling ACPI methods.\n\n# Features\n## Battery Conservation\nBattery conservation (mode) is a feature that allows you to save battery life by limiting the battery percentage to 60%.\n\n```rust\nideapad::initialize()?;\n\nif ideapad::battery_conservation::enabled()? {\n    println!(\"Battery conservation mode is enabled\");\n} else if ideapad::battery_conservation::disabled()? {\n    println!(\"Battery conservation mode is disabled\");\n} else {\n    panic!(\"what\");\n}\n\nbattery_conservation::enable()?;\nprintln!(\"Battery conservation mode should be enabled now...\");\n\nif battery_conservation::enabled()? {\n    println!(\"...and it is.\")\n} else {\n    panic!(\"...but it isn't!\");\n}\n\nbattery_conservation::disable()?;\nprintln!(\"Battery conservation mode should be disabled now...\");\n\nif battery_conservation::disabled()? {\n    println!(\"...and it is.\")\n} else {\n    panic!(\"...but it isn't!\");\n}\n```\n\nThis mode conflicts with rapid charging, because once the battery percentage is 60%, rapid charging will still try to\ncharge the battery more, but it can't, unnecessarily straining the battery.\n\nThere are various ways to mitigate this problem, provided by this crate:\n\n * `Ignore`: Ignore this problem entirely.\n * `Switch`: Switch off rapid charging, then enable battery conservation mode.\n * `Error`: Return an error to the caller.\n\nFor more information see `ideapad::Handler`.\n\n```rust\nideapad::initialize()?;\nideapad::rapid_charge::enable()?;\nideapad::battery_conservation::enable()?; // the default handler is to switch\nassert!(ideapad::rapid_charge::disabled()?);\n\nideapad::rapid_charge::enable()?;\nideapad::battery_conservation::enable_unchecked()?; // another handler is to ignore the problem entirely\nassert!(rapid_charge::enabled()?);\n\nlet error = ideapad::battery_conservation::enable_strict().unwrap_err(); // another handler is to error\nassert!(matches!(error, ideapad::battery_conservation_mode::Error::RapidChargeEnabled));\n\n// you can arbitrarily choose which handler to use\nideapad::rapid_charge::enable_with_handler(ideapad::Handler::Ignore)?;\nideapad::rapid_charge::enable_with_handler(ideapad::Handler::Switch)?;\nideapad::rapid_charge::enable_with_handler(ideapad::Handler::Error)?;\n```\n\n## Rapid Charging\nRapid charging is a feature that allows you to charge your laptop faster. *I have no idea how this works.*\n\n```rust\nideapad::initialize()?;\n\nif ideapad::rapid_charge::enabled()? {\n    println!(\"Rapid charge is enabled\");\n} else if ideapad::rapid_charge::disabled()? {\n    println!(\"Rapid charge is disabled\");\n} else {\n    panic!(\"what\");\n}\n\nrapid_charge::enable()?;\nprintln!(\"Rapid charge should be enabled now...\");\n\nif rapid_charge::enabled()? {\n    println!(\"...and it is.\")\n} else {\n    panic!(\"...but it isn't!\");\n}\n\nrapid_charge::disable()?;\nprintln!(\"Rapid charge should be disabled now...\");\n\nif battery_conservation::disabled()? {\n    println!(\"...and it is.\")\n} else {\n    panic!(\"...but it isn't!\");\n}\n```\n\nThis mode conflicts with battery conservation. See the **Battery Conservation** section above for more information.\n\n```rust\nideapad::initialize()?;\nideapad::battery_conservation::enable()?;\nideapad::rapid_charge::enable()?; // the default handler is to switch\nassert!(ideapad::battery_conservation::disabled()?);\n\nideapad::battery_conservatio::enable()?;\nideapad::rapid_charge::enable_unchecked()?; // another handler is to ignore the problem entirely\nassert!(battery_conservation::enabled()?);\n\nlet error = ideapad::rapid_charge::enable_strict().unwrap_err(); // another handler is to error\nassert!(matches!(error, ideapad::rapid_charge::Error::BatteryConservationEnabled));\n\n// you can arbitrarily choose which handler to use\nideapad::rapid_charge::enable_with_handler(ideapad::Handler::Ignore)?;\nideapad::rapid_charge::enable_with_handler(ideapad::Handler::Switch)?;\nideapad::rapid_charge::enable_with_handler(ideapad::Handler::Error)?;\n```\n\n## System Performance Mode\nSystem performance mode are a variety of presets that can be set to improve the performance of your laptop.\n\n * **Extreme Performance**: As the name suggests, this mode will set the system to the highest performance possible. For **gamers**, I guess.\n * **Intelligent Cooling**: This mode throttles the CPU and lowers the fan noise.\n * **Battery Saving**: This mode will set the system to the lowest possible performance.\n\n## Profiles\nNote that this feature is not provided by Lenovo and is provided by this crate.\n\nProfiles store ACPI methods and values that are used to set the system to a specific state. There are built in ones,\nsee **Supported Models** above, but you can also create your own (if you know what you're doing!).\n\n# Supported Operating Systems\nCurrently, `ideapad` is only supported on Linux systems due to its aforementioned dependency on the \n[`acpi_call`](https://github.com/mkottman/acpi_call) kernel module.\n\nAfter a few minutes of research, it seems like Windows does not support calling arbitrary ACPI methods in userspace. In\norder to get around this, it seems a driver is needed to call the ACPI methods.\n\n# Application\nIf you want to see this library being used in an application, see the \n[`tuxvantage`](https://github.com/ALinuxPerson/tuxvantage) project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinuxperson%2Fideapad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falinuxperson%2Fideapad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falinuxperson%2Fideapad/lists"}