Battery
info = eval( `ioreg -w0 -l | grep LegacyBatteryInfo`.gsub(/=/, '=>').gsub(/^.*¥{/, '{') )
percentage = info["Current"].to_f / info["Capacity"] * 100
puts percentage
info = eval( `ioreg -w0 -l | grep LegacyBatteryInfo`.gsub(/=/, '=>').gsub(/^.*¥{/, '{') )
percentage = info["Current"].to_f / info["Capacity"] * 100
puts percentage