Improve several outputs

pull/2549/head
Zijie He 7 years ago committed by Frans de Jonge
parent 726b15ad01
commit 4f1cabcdbc

@ -476,9 +476,9 @@ function FileManager:getSortingMenuTable()
local fm = self local fm = self
local collates = { local collates = {
strcoll = {_("title"), _("Sort by title")}, strcoll = {_("title"), _("Sort by title")},
access = {_("date read"), _("Sort by date of last read")}, access = {_("date read"), _("Sort by last read date")},
change = {_("date added"), _("Sort by date of adding")}, change = {_("date added"), _("Sort by date added")},
modification = {_("date modified"), _("Sort by date of modification")}, modification = {_("date modified"), _("Sort by date modified")},
size = {_("size"), _("Sort by size")}, size = {_("size"), _("Sort by size")},
type = {_("type"), _("Sort by type")}, type = {_("type"), _("Sort by type")},
} }

@ -8,6 +8,8 @@ if Device:isKobo() or Device:isPocketBook() then
filter = "mmcblk" filter = "mmcblk"
elseif Device:isKindle() then elseif Device:isKindle() then
filter = "' /mnt/us$'" filter = "' /mnt/us$'"
elseif Device:isSDL() then
filter = "/dev/sd"
else else
return { disabled = true, } return { disabled = true, }
end end
@ -24,8 +26,8 @@ local StorageStat = WidgetContainer:new{
callback = function() callback = function()
local std_out = io.popen( local std_out = io.popen(
"df -h | sed -r 's/ +/ /g' | grep " .. filter .. "df -h | sed -r 's/ +/ /g' | grep " .. filter ..
" | cut -d ' ' -f 2,3,4,5 | " .. " | cut -d ' ' -f 2,3,4,5,6 | " ..
"awk '{print \"Internal Storage: \\n Available: \" $3\"/\" $1 \"\\n Used: \" $4}'" "awk '{print $5\": \\n Available: \" $3\"/\" $1 \"\\n Used: \" $4}'"
) )
local msg local msg
if std_out then if std_out then

Loading…
Cancel
Save