linux上链接usb设备,在linux上弹出USB设备

我在python中通过dbus使用Udisks来卸载USB设备(本例中为Kindle),但是我想将弹出信号发送给它,因为这会将Kindle从USB模式退回到其常用界面。

Udisk不会让我DriveEject,因为它不是一个实际的驱动器,我收集这是一个功能。给出的错误是:

dbus.exceptions.DBusException: org.freedesktop.UDisks.Error.Failed: Device is not a driveUdisks documentation提到可弹出属性:

ID_DRIVE_EJECTABLE

Whether the media in the drive is

physically ejectable. Only set this to

1 (or 0) if the drive truly uses (or

doesn't) ejectable media. In

particular, it is not necessary to set

this for e.g. iPod or Kindle devices

where it is necessary to send a

command via eject(1) since the desktop

user session will offer this option

for removable devices regardless of

whether they are ejectable. If this

property is not set, a heuristic will

be used to determine if the media is

ejectable (drives using optical, Zip

or Jaz media are considered

ejectable).

但并未解释如何从桌面用户会话执行此操作。

(Nautilus可以让我从桌面shell弹出,'eject'shell命令将会卸载,但不会在没有sudo的情况下将弹出信号发送到设备)

是否有任何合法的方式来与Udisk进行这项工作,如果不是,Nautlius如何去做呢?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值