diff --git a/src/i_o.lua b/src/i_o.lua index b00da6f..07bb153 100644 --- a/src/i_o.lua +++ b/src/i_o.lua @@ -57,7 +57,7 @@ local read_entire_file = function(file, regex, mode) local str = file:read(mode or '*a') file:close() if not str then return end - if regex then return __string_match(str, regex) or '' else return str end + if regex then return __string_match(str, regex) else return str end end M.read_file = function(path, regex, mode) diff --git a/src/modules/graphics.lua b/src/modules/graphics.lua index 3a67524..b07811c 100644 --- a/src/modules/graphics.lua +++ b/src/modules/graphics.lua @@ -15,7 +15,6 @@ return function(update_freq, config, common, width, point) -- nvidia state i_o.assert_exe_exists(NVIDIA_EXE) - i_o.assert_file_exists(config.dev_power) -- vars to process the nv settings glob -- @@ -52,7 +51,7 @@ return function(update_freq, config, common, width, point) local update_state = function() if i_o.read_file(config.dev_power, nil, '*l') == 'on' then local nvidia_settings_glob = i_o.execute_cmd(NV_QUERY) - if nvidia_settings_glob == '' then + if nvidia_settings_glob == nil then mod_state.error = 'Error' else mod_state.used_memory,