Last active
January 1, 2024 23:00
-
-
Save mid-kid/c4eae19b20d251d2b55008e42998180f to your computer and use it in GitHub Desktop.
Revisions
-
mid-kid revised this gist
Jan 1, 2024 . No changes.There are no files selected for viewing
-
mid-kid created this gist
Jan 1, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #include <stdlib.h> #include <stdio.h> #include <X11/Xlib.h> // Simple program to check for the presence of an Xembed tray // Exits with status 0 if the tray exists int main() { Display *d = XOpenDisplay(NULL); if (!d) { fprintf(stderr, "XOpenDisplay failed\n"); return EXIT_FAILURE; } Atom a = XInternAtom(d, "_NET_SYSTEM_TRAY_S0", False); if (a == None) { fprintf(stderr, "XInternAtom failed\n"); return EXIT_FAILURE; } Window w = XGetSelectionOwner(d, a); if (w == None) { fprintf(stderr, "XGetSelectionOwner failed\n"); return EXIT_FAILURE; } return EXIT_SUCCESS; }