Skip to content

Instantly share code, notes, and snippets.

@fourdollars
Created June 6, 2014 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourdollars/8bc92cb87fe1d236b3c5 to your computer and use it in GitHub Desktop.
Save fourdollars/8bc92cb87fe1d236b3c5 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python3
from gi.repository import GLib, UDisks
no_options = GLib.Variant('a{sv}', {})
udisks = UDisks.Client.new_sync(None)
manager = udisks.get_object_manager()
for item in manager.get_objects():
part = item.get_partition()
swap = item.get_swapspace()
if not swap or not part:
continue
block = item.get_block()
print(block.props.id_uuid)
print(block.props.device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment