I was looking into porting kindd, a Qt QUI for the dd command, that helps you burn bootable .iso files onto a thumb drive.

It uses a polkit to sense when a new USB drive is plugged in. Appears to compile clean all except for this part.

Just curious if there is any sample haiku code that I could pull from that senses when a USB drive has been plugged in?


Maybe USBDeskbar?

1 Like

You can probably use BUsbRoster to detect changes on USB ports (I guess this is what USBDeskbar does), but ideally this would rather detect mass storage devices, so maybe have a look at DiskProbe or DriveSetup which are apps keeping track of that. I don’t know if either of them does live updates, however.

Polkit doesn’t provide USB device watching. An example of the functionality with BDiskDeviceRoster is found at haiku/AutoMounter.cpp at 7b3e89c0944ae1efa9a8fc66c7303874b7a344b2 · haiku/haiku · GitHub

1 Like

ok, great… thanks for the suggestions, I’ll take a look.

Polkit (Policy Kit) is a framework for privilege control based on actions and rules. Ie: allow users to mount usb mass storage devices.