I've had a look at the source code that does the test for "removable" and it looks like this:
Code: Select all
...
} else if (g_strcmp0 (condition, "removable") == 0) {
gboolean is_removable = FALSE;
if (g_list_length (selection) > 0) {
GMount *mount = nemo_file_get_mount (selection->data);
if (mount) {
GDrive *drive = g_mount_get_drive (mount);
if (drive) {
if (g_drive_is_media_removable (drive))
is_removable = TRUE;
g_object_unref (drive);
}
}
}
condition_type_show = is_removable;
} else if (g_str_has_prefix (condition, "gsettings")) {
...
After some checking up it would appear that
g_drive_is_media_removable identifies devices with removable
media not a removable device.
So basically, how do I identify a unmountable mount point as a condition?
How do I know using gsettings or dbus if the selection is mounted and I can umount it ?