diff --git a/awesome/battery.lua b/awesome/battery.lua index 65fc72f..d90e824 100644 --- a/awesome/battery.lua +++ b/awesome/battery.lua @@ -9,14 +9,14 @@ local beautiful = require("beautiful") local previous_percent = 0 function batteryInfo() - local fd = io.popen('acpi | tail -n 1 | cut -d ":" -f 2 | cut -d "," -f 2 | tr -d "%"') + local fd = io.popen('acpi | head -n 1 | cut -d ":" -f 2 | cut -d "," -f 2 | tr -d "%"') local percentage = fd:read('*all') fd:close() return tonumber(percentage) end function isCharging() - local _,_,error = os.execute('acpi | grep Discharging') + local _,_,error = os.execute('acpi | head -n 1 | grep Discharging') return error ~= 0 end