Libue
A self-contained minimal library for interacting with Linux hot-plug events
Install / Use
/learn @houqp/LibueREADME
libue 
Zero dependency minimal library for interacting with Linux hot-plug events.
Installation
Just drop the header file into your C project.
Usage
#include "libue.h"
int main() {
struct uevent_listener listener;
struct uevent uev;
int re;
re = ue_init_listener(&listener);
if (re < 0) {
fprintf(stderr, "Failed to initilize libue listener, err: %d\n", re);
return -1;
}
/* blocking call */
while ((re = ue_wait_for_event(&listener, &uev)) == 0) {
switch (uev.action) {
case UEVENT_ACTION_ADD:
printf("Device %s added.", uev.devpath);
break;
case UEVENT_ACTION_REMOVE:
printf("Device %s removed.", uev.devpath);
break;
}
}
}
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
