867 --local fh = _assert(io.popen("amixer cget name=\"Headphone Swit 868 --local state = fh:read("*a") 869 --fh:close() 870 local fh = _assert(io.popen("amixer cget name=\"Headphone Switch 871 local _,_,state = fh:read("*a"):find(": values=(%d+)") 872 fh:close() 873 874 -- revert to headphones if needed 875 --if state and state:sub(1,1) == "1" then 876 if state == "1" then 877 os.execute("amixer -q sset Endpoint Headphone") 878 end