Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- conky lua script to display mounted drives and of the sort.
- -- made by Dre k West, !GGGentooDY
- function trim(s)
- return (s:gsub("^%s*(.-)%s*$", "%1"))
- end
- function conky_filesystemlist(size)
- local rtvar = ""
- local df_output = io.popen("df")
- for line in df_output:lines() do
- --we find where its mounted:
- p = string.find(line,"%",1,true) --plain search
- p = p+2 -- we want to get past the "% "
- dir = trim(string.sub(line,p))
- --print( dir)
- local exclude_dirs = { "/","/dev","/dev/shm", "/lib64/rc/init.d", "/home" }
- if not ( dir == "Mounted on" or
- dir == "/" or
- dir == "/dev" or
- dir == "/dev/shm" or
- dir == "/lib64/rc/init.d" or
- dir == "/home") then
- rtvar = rtvar .. "${fs_bar "..size.." " .. dir .."}\n"
- rtvar = rtvar .. dir .. " $alignr ${fs_used " .. dir .."} / ${fs_size " .. dir .. "}\n\n"
- end
- --print( p)
- --return_str = return_str .. "${fs_bar 4 " .. line
- end
- io.close(df_output)
- return rtvar
- end
- function conky_kernellog()
- local rtvar = ""
- for line in io.popen("dmesg | tail")do
- rtvar = rtvar .. line
- end
- return rtvar
- end
Add Comment
Please, Sign In to add comment