Skip to content

Instantly share code, notes, and snippets.

@Vanuan
Created May 10, 2013 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vanuan/5553955 to your computer and use it in GitHub Desktop.
Save Vanuan/5553955 to your computer and use it in GitHub Desktop.
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <iostream>
/**
g++ -g `pkg-config gtk+-2.0 --cflags` -c get_wm_name.cpp
g++ get_wm_name.o `pkg-config gtk+-2.0 --libs`
**/
int main(int argc, char**argv) {
gtk_init(&argc, &argv);
GdkScreen * screen = gdk_screen_get_default ();
if (screen) {
std::cout << "Going to fetch wm name" << std::endl;
const char* name = gdk_x11_screen_get_window_manager_name (screen);
std::cout << name << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment