#include #include #include "got-gui/command.h" #include "got-gui/xutil.h" int main() { auto display = x::XOpenDisplayRAII(nullptr); Display *dpy = display.first; x::globalKeyboardGrab(dpy, [dpy](const XKeyEvent &ev) -> bool { x::Keycode kc{ev.keycode}; if (kc == x::Keysym{XK_Up}.toCode(dpy)) { runCommand({"brightness", "+"}); } else if (kc == x::Keysym{XK_Down}.toCode(dpy)) { runCommand({"brightness", "-"}); } else { return true; } return false; }); }