nekr0z / matebook-applet Goto Github PK
View Code? Open in Web Editor NEWSystem tray applet/control app for Huawei Matebook
License: GNU General Public License v3.0
System tray applet/control app for Huawei Matebook
License: GNU General Public License v3.0
The windows that applet opens (the one that opens when "CUSTOM" is clicked, as well as the main window of windowed mode) don't look good. Controls are poorly aligned and look almost as if they were put in the window with no aesthetics but pure functionality in mind (which happens to actually be true).
This can and should be fixed, but requires at least a sketch of what a better arrangement of controls should look like. I'm not fit for that (hey, I did what I did the way I did it for the reason: I'm totally not a visual person).
Установил апплет, через matebooc-applet -w вызвал оболочку и выбрал режим HOME. никакой реакции. Выставил пороги в Custom - аналогично полный игнор со стороны ноутбука. подскажите пожалуйста, в чем может быть загвоздка? А вот режим Fn-Lock отрабатывает на УРА
Hello, Could you please help me? Im trying to compile on Fedora 32 and I got this error:
$ go run build.go
Building version 2.4.8.7+g75d7100
Building as of 2020-05-19 08:34:54 +0200 CEST
go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags
# github.com/nekr0z/matebook-applet
/usr/bin/ld: $WORK/b001/_pkg1_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: $WORK/b001/_pkg2_.a(_cgo_defun.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
collect2: error: ld returned 1 exit status
2020/06/25 11:03:26 failed to build binary
exit status 1
Cant find how to fix this problem.
Hi for some reason ive just notice today, i couldnt do anything with the huawei logo key
but when i use the f10 buton and toggle fn.. it acts as f10...
Do you think they change the key from XF86Tools to something else?
please let me know thanks
Hi, I tried using a matebook applet, but I get this error.
WARNING: 2020/07/05 17:42:31 driver.go:166: Driver interface is readable but not writeable. ERROR: 2020/07/05 17:42:31 driver.go:324: failed to set thresholds ERROR: 2020/07/05 17:42:31 driver.go:268: Failed to set min threshold ERROR: 2020/07/05 17:42:31 driver.go:268: Failed to set min threshold WARNING: 2020/07/05 17:42:31 driver.go:166: Driver interface is readable but not writeable.
My laptop is 2020 Huawei Matebook 13 AMD Ryzen 5.
Can you help me? What should I do?
I downloaded your compiled version of matebook-applet
i run it on my st terminal as such ./matebook-applet
i get that error , possible missing dependency?
matebook-applet
lacks a manpage, which would be welcome for packaging.
How to add widget loading to the system tray on Artix linux with kde plasma desktop and openrc initialization system ?
As of linux 5.5, Huawei-WMI driver v3.3 is included by default (as such, I removed the separate package I had for it). However, when I run matebook-applet
I get the following output:
$ matebook-applet
WARNING: 2020/01/23 14:50:56 driver.go:166: Driver interface is readable but not writeable.
ERROR: 2020/01/23 14:50:56 driver.go:324: failed to set thresholds
ERROR: 2020/01/23 14:50:56 driver.go:268: Failed to set min threshold
WARNING: 2020/01/23 14:50:56 driver.go:421: BP thresholds don't make sense: min 0%, max 0%
ERROR: 2020/01/23 14:50:56 driver.go:268: Failed to set min threshold
(matebook-applet:13789): Gdk-CRITICAL **: 14:50:56.382: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
WARNING: 2020/01/23 14:51:03 driver.go:421: BP thresholds don't make sense: min 0%, max 0%
Running as root doesn't show these errors, but as you describe in #10, is a bad idea:
sudo matebook-applet
(matebook-applet:14000): libappindicator-WARNING **: 14:57:21.006: Unable to get the sessionbus: Error spawning command line “dbus-launch --autolaunch=095041c0c9cc4929b7a602f7852d5a45 --binary-syntax --close-stderr”: Child process exited with code 1
From #10, I can sort of gather that I need to add myself to a group (which makes sense), but for some reason you both decided to discuss the issue in Russian. Any fix? Do you think I configured something wrong?
(btw, I am runing 5.5rc-7, due to a very annoying i915 bug. It's probably out officially in a few days, anyway.)
libayatana-appindicator3
is not available for Fedora 34, thus the last version of the applet is not working on that system.
People are running MacOS on Matebooks, and it looks like matebook-applet
would be welcome there.
It should be relatively easy to add MacOS-specific endpoints and have them probed when running the applet on MacOS. All our dependencies support MacOS, so there shouldn't be a problem.
Two things prevent me from implementing this straight away:
Sorry if this is a naiive question, but I still don't quite understand after reading the documentation
How is the "battery protection" huawei specific? Under KDE (Kubuntu) I can go to the battery/power setting and put in any value for the maximum charge percentage. Is that functionally different from what this applet achieves? From reading the "Huawei WMI" repo README it sounds like there is something additional going on on the hardware level - but I guess I don't really get what haha
Thank you for releasing this and sorry for the ignorant question :)
Hello, I am on Matebook 14 2020 AMD.I cant seem to get matebook-applet to work. It worked fine on my D14. I tried running as root and fixing the perms.
Logs:
INFO: 2020/11/19 12:30:51 main.go:61: matebook-applet version 2.4.8
TRACE: 2020/11/19 12:30:51 driver.go:135: Fn-lock is OFF
TRACE: 2020/11/19 12:30:51 driver.go:197: Checking if the fnlock endpoint is writable...
TRACE: 2020/11/19 12:30:51 driver.go:135: Fn-lock is OFF
TRACE: 2020/11/19 12:30:51 driver.go:161: successful write to driver interface
INFO: 2020/11/19 12:30:51 main.go:104: Found writable fnlock endpoint, will use it
TRACE: 2020/11/19 12:30:51 driver.go:241: got values from interface: [0 0]
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
TRACE: 2020/11/19 12:30:51 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2020/11/19 12:30:51 driver.go:241: got values from interface: [0 0]
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
ERROR: 2020/11/19 12:30:51 driver.go:324: failed to set thresholds
TRACE: 2020/11/19 12:30:51 driver.go:229: Couldn't access "/sys/devices/platform/huawei-wmi/charge_thresholds".
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
TRACE: 2020/11/19 12:30:51 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
ERROR: 2020/11/19 12:30:51 driver.go:268: Failed to set min threshold
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT1/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT2/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT3/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT4/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT5/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT6/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT7/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT8/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 driver.go:292: Couldn't access "/sys/class/power_supply/BAT9/charge_control_start_threshold".
TRACE: 2020/11/19 12:30:51 main.go:71: looking for endpoint to save thresholds to...
TRACE: 2020/11/19 12:30:51 driver.go:241: got values from interface: [0 0]
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
INFO: 2020/11/19 12:30:51 main.go:75: Persistence thresholds values endpoint found.
TRACE: 2020/11/19 12:30:51 applet.go:35: Setting up menu...
INFO: 2020/11/19 12:30:51 applet.go:143: Couldn't get custom icon, falling back to default
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
WARNING: 2020/11/19 12:30:51 driver.go:421: BP thresholds don't make sense: min 0%, max 0%
TRACE: 2020/11/19 12:30:51 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2020/11/19 12:30:51 driver.go:262: interpreted values: min 0%, max 0%
ERROR: 2020/11/19 12:30:51 driver.go:268: Failed to set min threshold
TRACE: 2020/11/19 12:30:51 applet.go:60: no way to change BP settings, not showing the corresponding GUI
TRACE: 2020/11/19 12:30:51 driver.go:135: Fn-lock is OFF
TRACE: 2020/11/19 12:30:51 applet.go:69: Menu is now ready
TRACE: 2020/11/19 12:30:51 applet.go:103: Setting up GUI thread...
Files on /sys/devices/platform/huawei-wmi
charge_control_thresholds driver driver_override fn_lock_state input leds modalias power subsystem uevent
Не работает с wayland.
✘ neon@neon-book ~ sudo matebook-applet
[sudo] пароль для neon:
No protocol specified
Unable to init server: Не удалось подключиться к: В соединении отказано
(matebook-applet:3215): Gtk-WARNING **: 16:35:41.616: cannot open display: :0
The applet is not able to change bettery settings and does not show the menu :
TRACE: 2020/12/12 01:26:29 driver.go:262: interpreted values: min 40%, max 70%
ERROR: 2020/12/12 01:26:29 driver.go:268: Failed to set min threshold
TRACE: 2020/12/12 01:26:29 applet.go:60: no way to change BP settings, not showing the corresponding GUI
I'd love to see an option to disable the applet and use a simple window to control battery and fn-lock.
после занесения в список источников:
deb [signed-by=/usr/share/keyrings/matebook-applet.key] http://evgenykuznetsov.org/repo/ stable main
а так же добавления ключа:
wget -qO - https://raw.githubusercontent.com/nekr0z/matebook-applet/master/matebook-applet.key | sudo tee /usr/share/keyrings/matebook-applet.key
Выполняю команду sudo apt install matebook-applet и получаю данное сообщение.
Ubuntu lts 20.04, Kernel: 5.13.0-51-generic (x86_64)
Sometimes after rebooting the udev rule doesn't change ownership/permission of charge_thresholds
/fn_lock_state
. I haven't found log files, but I assume it is a race condition because mostly it works. Maybe when the huawei-wmi
folder is created in sysfs, it triggers the rule before the files charge_thresholds
/fn_lock_state
have been created.
While trying to install matebook-applet
into Debian Bullsye (11, testing) have problem with package dependency
$ sudo apt install matebook-applet
...
The following packages have unmet dependencies:
matebook-applet : Depends: libappindicator3-1 but it is not installable
E: Unable to correct problems, you have held broken packages.
Found this bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037
So, as I can understand there will no support for libappindicator3-1
in the newer Debian (Debian derivatives?)
Additional info:
$ uname -a
Linux laptop 5.10.0-3-amd64 #1 SMP Debian 5.10.13-1 (2021-02-06) x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux bullseye/sid
Release: testing
Codename: bullseye
I'm on a MateBook D 14" AMD and I've noticed that the charge thresholds are reset to OFF (0 100) after some reboots or maybe a longer power off period, not sure. Is it known when exactly this happens? Does this also happen to other models?
What if the applet would additionally write the actual charge thresholds to a file each time the user changes them? This file could be read by a udev rule to initialize the sysfs attribute on boot. Alternatively a file could be stored at /etc/default/huawei-wmi and is edited manually. (A simple ATTR{charge_thresholds}="40 70"
is good enough for me.)
Hello, I have Matebook 14 2021 AMD Ryzen 5 version. I have battery issues on Archlinux KDE (kernel 5.14 and lts-5.10) so I want to try matebook-applet to solve my problems (system sometimes =KDE applet and console command upower -e
= shows me battery is charging even if laptop is on battery only, baterry settings don't work, it behave like in AC power). Maybe that applet will help I think but I cannot start last version because dependency libayatana-appindicator
. I install libappindicator
but it still asks for libayatana-appindicator
I try to build from AUR but have build error. I install matebook-applet from AUR but this version is old 2.5.0-1.
Regards,
Przemek
build evgenykuznetsov.org/go/matebook-applet: cannot load embed: cannot find module providing package embed
when i run
$ git clone https://github.com/nekr0z/matebook-applet.git
$ cd matebook-applet
$ go build
I got this message on Manjaro instead of battery options. Matebook 13
The applet requires /sys/devices/platform/huawei-wmi/
hooks to be user-writeable to be fully functional. This can be achieved by udev rules, and those need to be shipped (along with installation instruction).
It's complaining about a missing icon. I'm on version 1.2.2
INFO: 2019/04/26 21:29:58 main.go:83: matebook-applet version custom-build
TRACE: 2019/04/26 21:29:58 main.go:194: Checking to see if Huawei-WMI driver interface is accessible
INFO: 2019/04/26 21:29:58 main.go:201: driver interface is readable
INFO: 2019/04/26 21:29:58 main.go:208: successful write to driver interface
INFO: 2019/04/26 21:29:58 main.go:86: will use driver interface
TRACE: 2019/04/26 21:29:58 main.go:102: Setting up menu...
ERROR: 2019/04/26 21:29:58 main.go:451: open /Settings-icon.png: file does not exist
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6400d4]
goroutine 19 [running]:
main.getIcon(0x6d7457, 0x12, 0x0, 0x0, 0x0)
/home/ayman/.build/matebook-applet/main.go:453 +0xe4
main.onReady()
/home/ayman/.build/matebook-applet/main.go:103 +0xa0
github.com/getlantern/systray.Run.func2(0xc0000dc0c0, 0x6ea418)
/home/ayman/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:67 +0x3e
created by github.com/getlantern/systray.Run
/home/ayman/go/pkg/mod/github.com/getlantern/[email protected]/systray.go:65 +0xf0
I need use "echo 40 70 | sudo tee /sys/devices/platform/huawei-wmi/charge_control_thresholds" before start this software.
Hey there, I'm running this on a brand new MateBook 13 2020, and I'm consistently getting this error: BP thresholds don't make sense: min 0%, max 0%
INFO: 2020/12/18 02:41:52 main.go:61: matebook-applet version 2.4.8
TRACE: 2020/12/18 02:41:52 driver.go:135: Fn-lock is OFF
TRACE: 2020/12/18 02:41:52 driver.go:197: Checking if the fnlock endpoint is writable...
TRACE: 2020/12/18 02:41:52 driver.go:135: Fn-lock is OFF
TRACE: 2020/12/18 02:41:52 driver.go:161: successful write to driver interface
INFO: 2020/12/18 02:41:52 main.go:104: Found writable fnlock endpoint, will use it
TRACE: 2020/12/18 02:41:52 driver.go:241: got values from interface: [0 0]
TRACE: 2020/12/18 02:41:52 driver.go:262: interpreted values: min 0%, max 0%
TRACE: 2020/12/18 02:41:52 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2020/12/18 02:41:52 driver.go:241: got values from interface: [0 0]
TRACE: 2020/12/18 02:41:52 driver.go:262: interpreted values: min 0%, max 0%
TRACE: 2020/12/18 02:41:52 driver.go:326: successful write to driver interface
INFO: 2020/12/18 02:41:52 main.go:119: Found writable battery thresholds endpoint, will use it
TRACE: 2020/12/18 02:41:52 main.go:71: looking for endpoint to save thresholds to...
TRACE: 2020/12/18 02:41:52 driver.go:241: got values from interface: [0 0]
TRACE: 2020/12/18 02:41:52 driver.go:262: interpreted values: min 0%, max 0%
INFO: 2020/12/18 02:41:52 main.go:75: Persistence thresholds values endpoint found.
TRACE: 2020/12/18 02:41:52 applet.go:35: Setting up menu...
INFO: 2020/12/18 02:41:52 applet.go:143: Couldn't get custom icon, falling back to default
TRACE: 2020/12/18 02:41:52 driver.go:241: got values from interface: [0 0]
TRACE: 2020/12/18 02:41:52 driver.go:262: interpreted values: min 0%, max 0%
WARNING: 2020/12/18 02:41:52 driver.go:421: BP thresholds don't make sense: min 0%, max 0%
TRACE: 2020/12/18 02:41:52 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2020/12/18 02:41:52 driver.go:241: got values from interface: [0 0]
TRACE: 2020/12/18 02:41:52 driver.go:262: interpreted values: min 0%, max 0%
TRACE: 2020/12/18 02:41:52 driver.go:326: successful write to driver interface
TRACE: 2020/12/18 02:41:52 driver.go:135: Fn-lock is OFF
TRACE: 2020/12/18 02:41:52 applet.go:69: Menu is now ready
TRACE: 2020/12/18 02:41:52 applet.go:103: Setting up GUI thread...
I couldn't find any solution to this in the existing issues, any help would be appreciated!
i get this when i run batpro and fnlock, am i missing some dependencies?
im using archlinux with i3 gaps, i3 status bar, huawei matebook 13 2019.
Hi,
I'm under Arch Linux actually and either compiling or using AUR one i have the same issue:
The upper limit is met, but not the lower one. Example it charges up to 70% however if at 50% I plug in it still charges until 70%.
Here is the log:
INFO: 2022/11/28 10:23:16 main.go:63: matebook-applet version custom-build
TRACE: 2022/11/28 10:23:16 driver.go:135: Fn-lock is OFF
TRACE: 2022/11/28 10:23:16 driver.go:197: Checking if the fnlock endpoint is writable...
TRACE: 2022/11/28 10:23:16 driver.go:135: Fn-lock is OFF
TRACE: 2022/11/28 10:23:16 driver.go:161: successful write to driver interface
INFO: 2022/11/28 10:23:16 main.go:106: Found writable fnlock endpoint, will use it
TRACE: 2022/11/28 10:23:16 driver.go:241: got values from interface: [40 70]
TRACE: 2022/11/28 10:23:16 driver.go:262: interpreted values: min 40%, max 70%
TRACE: 2022/11/28 10:23:16 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2022/11/28 10:23:16 driver.go:241: got values from interface: [40 70]
TRACE: 2022/11/28 10:23:16 driver.go:262: interpreted values: min 40%, max 70%
TRACE: 2022/11/28 10:23:16 driver.go:326: successful write to driver interface
INFO: 2022/11/28 10:23:16 main.go:121: Found writable battery thresholds endpoint, will use it
TRACE: 2022/11/28 10:23:16 main.go:73: looking for endpoint to save thresholds to...
TRACE: 2022/11/28 10:23:16 driver.go:241: got values from interface: [40 70]
TRACE: 2022/11/28 10:23:16 driver.go:262: interpreted values: min 40%, max 70%
INFO: 2022/11/28 10:23:16 main.go:77: Persistence thresholds values endpoint found.
TRACE: 2022/11/28 10:23:16 applet.go:38: Setting up menu...
INFO: 2022/11/28 10:23:16 applet.go:146: Couldn't get custom icon, falling back to default
TRACE: 2022/11/28 10:23:16 driver.go:241: got values from interface: [40 70]
TRACE: 2022/11/28 10:23:16 driver.go:262: interpreted values: min 40%, max 70%
TRACE: 2022/11/28 10:23:16 driver.go:192: Checking if the threshold endpoint is writable...
TRACE: 2022/11/28 10:23:16 driver.go:241: got values from interface: [40 70]
TRACE: 2022/11/28 10:23:16 driver.go:262: interpreted values: min 40%, max 70%
TRACE: 2022/11/28 10:23:16 driver.go:326: successful write to driver interface
TRACE: 2022/11/28 10:23:16 driver.go:135: Fn-lock is OFF
TRACE: 2022/11/28 10:23:16 applet.go:72: Menu is now ready
TRACE: 2022/11/28 10:23:16 applet.go:106: Setting up GUI thread...
Here some additional info:
cat /sys/devices/platform/huawei-wmi/charge_control_thresholds
→ 40 70
HI Im using Pop OS with kernel version 5.3.0-22-generic
I aalready have huawei wmi installed also the batpro scripts and fnlock
but this one i really cannot used...
everything is working fine on the huawei wmi, i can use my keyboard fine etc...
I really dont know why this is not able to run properly on my end
Hello! Does this applet use some special drivers from Huawei or just standard Linux libraries and drivers to limit battery charge? If the first one then maybe it is possible to create the same lightweight application for Windows to avoid using big voracious PC Manager.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.