Fix battery status changes not being detected
Historically we listened to /sys/class/poewr_supply inotify events, which does not seem to work anymore. We switched now to udev netlink kernel events.
This commit is contained in:
21
include/util/udev_deleter.hpp
Normal file
21
include/util/udev_deleter.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <libudev.h>
|
||||
|
||||
namespace waybar::util {
|
||||
struct UdevDeleter {
|
||||
void operator()(udev *ptr) const { udev_unref(ptr); }
|
||||
};
|
||||
|
||||
struct UdevDeviceDeleter {
|
||||
void operator()(udev_device *ptr) const { udev_device_unref(ptr); }
|
||||
};
|
||||
|
||||
struct UdevEnumerateDeleter {
|
||||
void operator()(udev_enumerate *ptr) const { udev_enumerate_unref(ptr); }
|
||||
};
|
||||
|
||||
struct UdevMonitorDeleter {
|
||||
void operator()(udev_monitor *ptr) const { udev_monitor_unref(ptr); }
|
||||
};
|
||||
} // namespace waybar::util
|
Reference in New Issue
Block a user