use helpers.shellquote to escape warg for safe usage on the command line
This commit is contained in:
parent
998aae0990
commit
54186b3151
|
@ -8,6 +8,7 @@ local tonumber = tonumber
|
|||
local io = { popen = io.popen }
|
||||
local string = { gmatch = string.gmatch }
|
||||
local setmetatable = setmetatable
|
||||
local helpers = require("vicious.helpers")
|
||||
-- }}}
|
||||
|
||||
|
||||
|
@ -19,7 +20,7 @@ local nvinf = {}
|
|||
local function worker(format, warg)
|
||||
if not warg then warg = "0" end
|
||||
local nv_inf = {}
|
||||
local f = io.popen("LC_ALL=C nvidia-settings -q GPUUtilization -q [gpu:"..warg.."]/GPUCoreTemp -q [gpu:"..warg.."]/GPUCurrentClockFreqs -t")
|
||||
local f = io.popen("LC_ALL=C nvidia-settings -q GPUUtilization -q [gpu:"..helpers.shellquote(warg).."]/GPUCoreTemp -q [gpu:"..helpers.shellquote(warg).."]/GPUCurrentClockFreqs -t")
|
||||
local all_info = f:read("*all")
|
||||
f:close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue