~kennylevinsen/poweralertd

647e1b285c8d68e7c326a4a4c7b3698cc94761dd — Kenny Levinsen 15 days ago 5d346a8 0.1.0 master
Use path/type fallback in remove as well
1 files changed, 6 insertions(+), 2 deletions(-)

M main.c
M main.c => main.c +6 -2
@@ 16,7 16,11 @@ static int send_remove(sd_bus *bus, struct upower_device *device) {
	enum urgency urgency = URGENCY_NORMAL;
	char title[NOTIFICATION_MAX_LEN];

	snprintf(title, NOTIFICATION_MAX_LEN, "Power status: %s", device->model);
	if (strlen(device->model) > 0) {
		snprintf(title, NOTIFICATION_MAX_LEN, "Power status: %s", device->model);
	} else {
		snprintf(title, NOTIFICATION_MAX_LEN, "Power status: %s (%s)", device->native_path, upower_device_type_string(device));
	}
	char *msg = "Device disconnected\n";

	return notify(bus, title, msg, 0, urgency);


@@ 204,4 208,4 @@ finish:
	sd_bus_unref(system_bus);

	return ret < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
\ No newline at end of file
}