Fix battery detection.
This commit is contained in:
@@ -60,7 +60,8 @@ func (c *MyConfig) UpdateBatteryInfo() {
|
|||||||
|
|
||||||
statusFile := filepath.Dir(file) + "/status"
|
statusFile := filepath.Dir(file) + "/status"
|
||||||
|
|
||||||
// If file exists.
|
_, err = os.Stat(statusFile)
|
||||||
|
|
||||||
if !os.IsNotExist(err) {
|
if !os.IsNotExist(err) {
|
||||||
b, err := os.ReadFile(statusFile)
|
b, err := os.ReadFile(statusFile)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user