Update 2025-08-11

This commit is contained in:
2025-08-11 17:36:33 +03:00
parent 5326bd7e21
commit b152e7546b
39 changed files with 1028 additions and 31 deletions

View File

@@ -224,6 +224,7 @@ function M.split(src)
{ "^/dev/nvme%d+n%d+", "p%d+$" }, -- /dev/nvme0n1p1
{ "^/dev/mmcblk%d+", "p%d+$" }, -- /dev/mmcblk0p1
{ "^/dev/disk%d+", ".+$" }, -- /dev/disk1s1
{ "^/dev/sr%d+", ".+$" }, -- /dev/sr0
}
for _, p in ipairs(pats) do
local main = src:match(p[1])
@@ -274,7 +275,10 @@ function M.operate(type)
output, err = Command("diskutil"):arg({ type, active.src }):output()
end
if ya.target_os() == "linux" then
if type == "eject" then
if type == "eject" and active.src:match("^/dev/sr%d+") then
Command("udisksctl"):arg({ "unmount", "-b", active.src }):status()
output, err = Command("eject"):arg({ "--traytoggle", active.src }):output()
elseif type == "eject" then
Command("udisksctl"):arg({ "unmount", "-b", active.src }):status()
output, err = Command("udisksctl"):arg({ "power-off", "-b", active.src }):output()
else