فهرست منبع

fix a bug caused by args swap

erpalma 6 سال پیش
والد
کامیت
301a57aa0f
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      etc/lenovo_fix.conf
  2. 1 1
      lenovo_fix.py

+ 1 - 1
etc/lenovo_fix.conf

@@ -2,7 +2,7 @@
 # Enable or disable the script execution
 Enabled: True
 # SYSFS path for checking if the system is running on AC power
-Sysfs_Power_Path = "/sys/class/power_supply/AC*/online"
+Sysfs_Power_Path: /sys/class/power_supply/AC*/online
 
 ## Settings to apply while connected to Battery power
 [BATTERY]

+ 1 - 1
lenovo_fix.py

@@ -153,7 +153,7 @@ def get_value_for_bits(val, from_bit=0, to_bit=63):
 
 def is_on_battery(config):
     try:
-        for path in glob.glob(config.get('Sysfs_Power_Path', 'GENERAL', fallback=DEFAULT_SYSFS_POWER_PATH)):
+        for path in glob.glob(config.get('GENERAL', 'Sysfs_Power_Path', fallback=DEFAULT_SYSFS_POWER_PATH)):
             with open(path) as f:
                 return not bool(int(f.read()))
     except: