Created
August 13, 2017 10:46
-
-
Save radxene/03d29b47b9f8c95b4ea8651642003931 to your computer and use it in GitHub Desktop.
Delete or Install gnome-shell-extension-window-list in Centos 7
This file contains 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 characters
/** | |
* For compiling program run: | |
* gcc -std=c99 window_list.c -o window_list.run | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define ANSI_COLOR_GREEN "\x1b[32m" | |
#define ANSI_COLOR_RESET "\x1b[0m" | |
#define EXTENSION "gnome-shell-extension-window-list" | |
#define REMOVE "--remove" | |
#define REMOVE_EXTENSION(ext) system("sudo yum remove " ext) | |
#define INSTALL "--install" | |
#define INSTALL_EXTENSION(ext) system("sudo yum install " ext) | |
int main(int argc, const char **argv) | |
{ | |
if (argc > 1) { | |
for (int i = 1; i < argc; ++i) { | |
if (strcmp(REMOVE, argv[i]) == 0) { | |
REMOVE_EXTENSION(EXTENSION); break; | |
} else if (strcmp(INSTALL, argv[i]) == 0) { | |
INSTALL_EXTENSION(EXTENSION); break; | |
} | |
} | |
} | |
printf("\n" ANSI_COLOR_GREEN "=> C Program Finished!" ANSI_COLOR_RESET "\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment