{"action":"created","issue":{"url":"https://api.github.com/repos/coldfix/udiskie/issues/122","repository_url":"https://api.github.com/repos/coldfix/udiskie","labels_url":"https://api.github.com/repos/coldfix/udiskie/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/coldfix/udiskie/issues/122/comments","events_url":"https://api.github.com/repos/coldfix/udiskie/issues/122/events","html_url":"https://github.com/coldfix/udiskie/issues/122","id":159845648,"number":122,"title":"Ways to query udiskie for information","user":{"login":"philer","id":4589347,"avatar_url":"https://avatars.githubusercontent.com/u/4589347?v=3","gravatar_id":"","url":"https://api.github.com/users/philer","html_url":"https://github.com/philer","followers_url":"https://api.github.com/users/philer/followers","following_url":"https://api.github.com/users/philer/following{/other_user}","gists_url":"https://api.github.com/users/philer/gists{/gist_id}","starred_url":"https://api.github.com/users/philer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philer/subscriptions","organizations_url":"https://api.github.com/users/philer/orgs","repos_url":"https://api.github.com/users/philer/repos","events_url":"https://api.github.com/users/philer/events{/privacy}","received_events_url":"https://api.github.com/users/philer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-12T20:21:05Z","updated_at":"2017-02-24T01:43:49Z","closed_at":"2016-07-05T14:22:33Z","body":"I'm trying to automate some stuff right now (basically mount a specific LUKS partition as part of a bigger process) which requires me to figure out the current device ID of a partition. While this is almost trivial as root (parsing the output of tools like `blkid` or `lsblk`) it's a lot more tedious to do as a regular user.\nI'm not even sure yet what the best way of implementing it will be. All I really need is a list of devices managed via udiskie/udisks2 (typically those not managed by `/etc/fstab`) with device file, file system, uuid, label, mount point (if any) and maybe size. So far I've been trying to build a bash script but the output of `udisksctl` is quite annoying to parse and working with dbus from bash is just plain masochism. You'd think that info is easy to get but alas… \n\nSo I could think of two ways to make this work in conjunction with udiskie:\n1. A cli tool like `udiskie-info` could be used to access information in simple readable format. For example \n   - `udiskie-info` could output a simple list of block devices mounted/mountable via udisks\n   - `udiskie-info --blkid` could output information in the typical `blkid` formatting. (In case anyone is wondering, native `blkid` doesn't return reliable information when run as non-root.)\n   - The output formatting options of `lsblk` could also serve as inspiration.\n2. If udiskie were to provide a (documented) Python API people could use that in a simple Python script and call it where needed. I'd really like that, actually.\n\nLet me know what you think. If you know a better way of doing what I'm trying to do I'll be happy as well.\n"},"comment":{"url":"https://api.github.com/repos/coldfix/udiskie/issues/comments/282178993","html_url":"https://github.com/coldfix/udiskie/issues/122#issuecomment-282178993","issue_url":"https://api.github.com/repos/coldfix/udiskie/issues/122","id":282178993,"user":{"login":"coldfix","id":1816880,"avatar_url":"https://avatars.githubusercontent.com/u/1816880?v=3","gravatar_id":"","url":"https://api.github.com/users/coldfix","html_url":"https://github.com/coldfix","followers_url":"https://api.github.com/users/coldfix/followers","following_url":"https://api.github.com/users/coldfix/following{/other_user}","gists_url":"https://api.github.com/users/coldfix/gists{/gist_id}","starred_url":"https://api.github.com/users/coldfix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coldfix/subscriptions","organizations_url":"https://api.github.com/users/coldfix/orgs","repos_url":"https://api.github.com/users/coldfix/repos","events_url":"https://api.github.com/users/coldfix/events{/privacy}","received_events_url":"https://api.github.com/users/coldfix/received_events","type":"User","site_admin":false},"created_at":"2017-02-24T01:43:49Z","updated_at":"2017-02-24T01:43:49Z","body":"@philer FYI, I have modified the `udiskie-info` utility to allow specifying a format string such as:\r\n\r\n```\r\nudiskie-info -a -o \"{device_presentation}:{is_luks}:{ui_label}\"\r\n```\r\n\r\nIt has access to the valid attributes.\r\nFurthermore, startup time for the utility will slightly decrease in the next release (hopefully)."}}
{"actor":{"display_login":"coldfix"}}