diff options
Diffstat (limited to 'src/wm_check.c')
| -rw-r--r-- | src/wm_check.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/wm_check.c b/src/wm_check.c new file mode 100644 index 0000000..5e153f8 --- /dev/null +++ b/src/wm_check.c @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +const char *checkWindowManager() { + char *desktopSession = getenv("DESKTOP_SESSION"); + if (desktopSession == NULL) { + return "Not Found"; + } else { + if (strstr(desktopSession, "xmonad") != NULL) { + return "xmonad"; + } else if (strstr(desktopSession, "herb") != NULL) { + return "herb"; + } else if (strstr(desktopSession, "awesome") != NULL) { + return "awesome"; + } else if (strstr(desktopSession, "dwm") != NULL) { + return "dwm"; + } else { + return desktopSession; + } + } +}
\ No newline at end of file |