项目作者: supdrewin

项目描述 :
An advanced Ideapad Laptops conservation mode adjustment tool.
高级语言: Shell
项目地址: git://github.com/supdrewin/batterycm-switcher.git
创建时间: 2021-08-24T06:45:06Z
项目社区:https://github.com/supdrewin/batterycm-switcher

开源协议:GNU General Public License v3.0

下载


Batterycm-Switcher

an advanced Ideapad Laptops conservation mode adjustment tool

What is the conservation mode?

Conservation mode is a battery protected mode in most Lenovo Ideapad Laptops. This mode work for disconnecting battery from your computer when AC power adapter is using. That mean battery overcharging can be avoid directly so that purging AC power adapter is unnecessary.

How to setup batterycm-switcher?

  • Required dependencies for this utility
  • bash: for running shell script
  • coreutils: for basic commands
  • man-db: for man page support
  • polkit/policykit-1: for access sysfs
  • vim: for config editing support
  • git(make): for clone this repos
  • gzip(make): for package man page
  • make(make): for make this utility
  • xz/xz-utils(make): for harden library support
  • acpid(optional): for capture function key support
  • espeak(optional): for voice prompt support
  • systemd(optional): for system service support
  • For ArchLinux users, the package batterycm-switcher is available from AUR.
    1. git clone https://aur.archlinux.org/batterycm-switcher.git
    2. cd batterycm-switcher
    3. makepkg -csi
  • For another distributions.
    • First install the required dependencies:
      • For Debian, some packages have different names:
        • xz is provided by xz-utils
        • polkit is provided by polkit-1.
      • For other distributions, you should correct it by yourself.
    • Than clone this repos and make it:
      1. git clone https://github.com/supdrewin/batterycm-switcher.git
      2. cd batterycm-switcher
      3. make
      4. sudo make install
  • For preview features, also see the branch testing.

    How to use batterycm-switcher?

    After install this utility, type batterycm-switcher help to get more information for using batterycm-switcher.
    ``` roff
    BATTERYCM-SWITCHER(1) User Commands BATTERYCM-SWITCHER(1)

NAME
batterycm-switcher - an advanced Ideapad Laptops conservation mode adjustment tool

SYNOPSIS
batterycm-switcher [ OPTION ]

DESCRIPTION
This manual page documents briefly the batterycm-switcher command.
Batterycm-Switcher is a useful commandline utility (CLI) to switch the conservation mode
of Ideapad Laptops. And it also provides series features to advanced users.

OPTIONS
call call the function key receive backend, this require acpid and ‘enable_re‐
ceive_funkey’ = 1. To enable show status using sound, it also needed to install
espeak and change the config option ‘enable_sound_prompt’ = 1.

  1. config Use `config` to enter config editing, the editor used is vim, which most powerful.
  2. You can special your own vimrc to use from the CUSTOMS section.
  3. debug Use `debug` to view the log of batterycm-switcher, the default loging location is
  4. '/var/tmp/batterycm-switcher.log'. You can change this location from config. It's
  5. actually depending on config option 'batterycm_debug_level' != 0. To enter the
  6. full debug mode, change the 'batterycm_debug_level' to 1.
  7. on / off
  8. Both optoins to turn on/off the battery conservation mode.
  9. auto / noauto
  10. Both options to enable/disable the Charging Threshold service, the default thresh‐
  11. old value is 95%. To custom the value, use `batterycm-switcher config` and go to
  12. the CUSTOMS section.
  13. enable / disable
  14. Both options to enable/disable the systemd service, which Batterycm-Switcher Func‐
  15. tion Key Backend Service. An backend service capture the function key opening
  16. Lenovo Vantage in Windows, the keycode depending on your hardware.
  17. help This option will jump to show this man page, you can also do this:
  18. `man batterycm-switcher`, which function is same as help.
  19. status This option to show current status of conservation mode, it will return a message
  20. whether the mode on/off.
  21. version
  22. This option to show current version of batterycm-switcher, program name will be
  23. shown as the core module name of batterycm-switcher.

NOTES
While no options special, batterycm will switch the conservation mode according to current
mode. If current mode is on, turning off, otherwise turning on.

  1. It's necessary to know that `batterycm-charger.service` is conflict with `batterycm-
  2. switcher.service` and other commands. So I highly NOT recommend use both at the same
  3. time.
  4. Don't reporting it as a bug if you don't have the `ideapad_laptop` driver. Use `lsmod |
  5. grep ideapad_laptop` to have a try, no any reasons to directly uninstall this utility.

SEE ALSO
batterycm-charger(1)

BUGS
https://github.com/supdrewin/batterycm-switcher/issues

AUTHORS
Supdrewin https://github.com/supdrewin

1.2.0 2021-08-28 BATTERYCM-SWITCHER(1)
```

Some special features of this utility

  • supports running in tmpfs
  • secure environment for runtime
  • supports charging threshold (optional)
  • voice for mode switching (optional: require espeak)
  • function key to switch mode (optional: require acpid)

    Help to improve this utility

  • Click here to report issues
  • Click here to pull requests