Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
502 B

4 years ago
  1. #include <stdio.h>
  2. #include <X11/Xlib.h>
  3. int
  4. main()
  5. {
  6. Display *dpy;
  7. char *name;
  8. if (!(dpy = XOpenDisplay(NULL))) {
  9. fputs("Error: could not open display.\n", stderr);
  10. return 1;
  11. }
  12. if (XFetchName(dpy, DefaultRootWindow(dpy), &name) && name[0])
  13. printf("%s\n", name);
  14. else
  15. puts("No name has been set for the root window.");
  16. XFree(name);
  17. XCloseDisplay(dpy);
  18. return 0;
  19. }