CrowPi L user made a APP to show the battery status of the CrowPi L in the system tray of the native Raspberry Pi OS. It is available on github. Battery status for the CrowPi L laptop, with the native Linux Raspberry Pi OS, standing in the system tray, written with python3 and python3-pyqt5.
- Running on the native Linux Raspberry Pi OS,
- standing in the system tray,
- 7 state icons of the battery from 0% to 100%,
- icon when charging,
- alert icon when battery is very low,
- tooltip to view the percentage of the battery load and its voltage,
- contextual menu to properly quit the app,
- based on the official python script delivered by CrowPi (/usr/local/sbin/getPowerBattery.py),
- multi-threaded app to access the battery data with I2C.
Installing and starting the applicationFrom a terminal, install python3-pyqt5
sudo apt install python3-pyqt5Clone this projet (the first time only), go to its directory, make it executable (the first time only), run it and enjoy!
git clone firstname.lastname@example.org:ppyne/crowPi-L_BatteryStatus.git
chmod +x ./batteryStatus.py
There're several problems you need to notice when install this APP.1.'git clone email@example.com:ppyne/crowPi-L_BatteryStatus.git' returns fatal error:
Please change 'git clone firstname.lastname@example.org:ppyne/crowPi-L_BatteryStatus.git' to
git clone https://github.com/ppyne/crowPi-L_BatteryStatus.gitThen the APP will be installed successfully
Please enable I2C interface.
Then the APP will work properly.
Warning: to quit the app properly, you must right click on its icon in the system tray and click the menu "Quit".
How to achieve automatically open battery monitor at boot-up？
Step1: Modify code in batteryStatus.py
Comment out the following code by adding #
QIcon("battery_charging.png"), # 8
QIcon("battery_alert.png"), # 9
QIcon("battery_unknown.png"), # 10
Then add the following code to change the icon image from a relative path to an absolute path: (Notice: Please change 'elecrow' to your user name)
QIcon("/home/elecrow/crowPi-L_BatteryStatus/battery_charging.png"), # 8
QIcon("/home/elecrow/crowPi-L_BatteryStatus/battery_alert.png"), # 9
QIcon("/home/elecrow/crowPi-L_BatteryStatus/battery_unknown.png"), # 10
Step 2: Create a .desktop file named 'laptop-battery' and put it in the directory "/ home / elecrow /. config / autostart". The contents of the file are:
Notice: The user name in the path should be changed according to yours