Advertisement
Guest User

Untitled

a guest
Feb 11th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. #include <X11/Xlib.h>
  5.  
  6. int main()
  7. {
  8. Display* d = XOpenDisplay(0);
  9. Window root = XDefaultRootWindow(d);
  10.  
  11. // this is the static version of the program which must be changed, to be configurable
  12. const unsigned char* newNames = (const unsigned char*) "as\0df\0"; // \0 seperated list of the new names (i.e. in this case first desktop is named "as" and second "df"
  13. int newNamesLength = 6; // 6 characters - including all the \0
  14. // end of the static stuff which should be made configurable
  15.  
  16. // if you have correctly initialized the variables newNames and newNamesLength, then the next command will just update your desktop names...
  17. XChangeProperty(d, root, XInternAtom(d, "_NET_DESKTOP_NAMES", false), XInternAtom(d, "UTF8_STRING", false), 8, PropModeReplace, newNames, newNamesLength);
  18. XCloseDisplay(d);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement