Created
July 6, 2018 23:37
-
-
Save CihatAltiparmak/f4945ad5883b9d06a5d94fa4be17668a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dbus | |
bus = dbus.SystemBus() | |
obj = bus.get_object("org.freedesktop.UDisks2", "/org/freedesktop/UDisks2/block_devices/sdb1") | |
iface = dbus.Iface(obj, "org.freedesktop.Dbus.Properties") | |
your_usb_device_name = iface.Get("org.freedesktop.UDisks2.Block","IdLabel") | |
print(your_usb_device_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you run this script,if usb device is inserted,this script gives you usb device name(IdLabel).