diff --git a/drawing/Processor.lua b/drawing/Processor.lua index b334290..4b5932a 100644 --- a/drawing/Processor.lua +++ b/drawing/Processor.lua @@ -205,9 +205,9 @@ local update = function(cr) CriticalText.set(core.coretemp_text, cr, Util.round_to_string(0.001 * Util.read_file(core.coretemp_path, nil, '*n'))) end - local process_glob = Util.execute_cmd('ps -A -o s') + local process_glob = Util.execute_cmd('ps -A -o s h') - --subtract one from running b/c ps will always be "running" + -- subtract one from running b/c ps will always be "running" Text.set(process.value, cr, __string_format('%s | %s | %s | %s | %s', (char_count(process_glob, 'R') - 1), diff --git a/main.lua b/main.lua index 9a7da5e..0afa8e0 100644 --- a/main.lua +++ b/main.lua @@ -169,7 +169,9 @@ cr_static = nil -- create some useful functions -- local using_ac = function() - return Util.read_file('/sys/class/power_supply/AC/online', nil, '*n') == 1 + -- for some reason it is much more efficient to test if the battery + -- is off than if the ac is on + return Util.read_file('/sys/class/power_supply/BAT0/status') ~= 'Discharging' end -- @@ -184,8 +186,6 @@ function conky_main() local _cw = conky_window if not _cw then return end - -- local time = os.clock() - local cs = __cairo_xlib_surface_create(_cw.display, _cw.drawable, _cw.visual, 1920, 1080) local cr = __cairo_create(cs) @@ -215,6 +215,4 @@ function conky_main() __cairo_surface_destroy(cs) __cairo_destroy(cr) __collectgarbage() - - -- print(os.clock() - time) end