FIX more bugs

This commit is contained in:
Nathan Dwarshuis 2022-07-21 22:12:06 -04:00
parent 148f99747d
commit e3cc7ecd4c
2 changed files with 2 additions and 3 deletions

View File

@ -57,7 +57,7 @@ local read_entire_file = function(file, regex, mode)
local str = file:read(mode or '*a') local str = file:read(mode or '*a')
file:close() file:close()
if not str then return end 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 end
M.read_file = function(path, regex, mode) M.read_file = function(path, regex, mode)

View File

@ -15,7 +15,6 @@ return function(update_freq, config, common, width, point)
-- nvidia state -- nvidia state
i_o.assert_exe_exists(NVIDIA_EXE) i_o.assert_exe_exists(NVIDIA_EXE)
i_o.assert_file_exists(config.dev_power)
-- vars to process the nv settings glob -- vars to process the nv settings glob
-- --
@ -52,7 +51,7 @@ return function(update_freq, config, common, width, point)
local update_state = function() local update_state = function()
if i_o.read_file(config.dev_power, nil, '*l') == 'on' then if i_o.read_file(config.dev_power, nil, '*l') == 'on' then
local nvidia_settings_glob = i_o.execute_cmd(NV_QUERY) 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' mod_state.error = 'Error'
else else
mod_state.used_memory, mod_state.used_memory,