Just cosmetics... ;)

This commit is contained in:
Johannes Findeisen 2025-01-13 06:50:11 +01:00
commit 00aa8cd38b

View file

@ -1,6 +1,6 @@
/**
* xtimer is a program that executes a givin program after a given time if no
* X11 keybord or mouse input happend in the given time.
* Xtimer is a program that executes a givin command or program after a given
* time if no X11 keybord or mouse input happend in the given time.
*
* Author: Johannes Findeisen <you@hanez.org> - 2025
* License: Apache-2.0 (see LICENSE)
@ -8,11 +8,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h> // For INT_MAX and INT_MIN
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>
#include <time.h>
#include <limits.h> // For INT_MAX and INT_MIN
int main(int argc, char *argv[])
{
@ -65,7 +65,7 @@ INT_MAX);
XISetMask(mask, XI_KeyRelease);
XISetMask(mask, XI_ButtonPress);
XISetMask(mask, XI_ButtonRelease);
XISetMask(mask, XI_Motion); // Listen for mouse motion events
XISetMask(mask, XI_Motion); // Listen for mouse motion events
if (XISelectEvents(display, root, &evmask, 1) != Success) {
fprintf(stderr, "Error: Unable to select input events.\n");
@ -91,7 +91,7 @@ INT_MAX);
XNextEvent(display, &event);
if (event.xcookie.type == GenericEvent &&
event.xcookie.extension == opcode && // Use the opcode obtained earlier
event.xcookie.extension == opcode && // Use the opcode obtained earlier
XGetEventData(display, &event.xcookie)) {
XIDeviceEvent *xi_event = (XIDeviceEvent *)event.xcookie.data;
if (xi_event->evtype == XI_KeyPress ||
@ -105,7 +105,7 @@ INT_MAX);
}
// Sleep briefly to reduce CPU usage
usleep(10000); // 10 milliseconds
usleep(10000); // 10 milliseconds
}
// Close the X display