Last active
June 29, 2020 22:32
-
-
Save andreldm/b971fa0d671a90ae133650f85ce2836a to your computer and use it in GitHub Desktop.
Icon lookup tester
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 characters
/* | |
* Build: | |
* gcc $(pkg-config --cflags gtk+-3.0) icon_tester.c -o icon_tester $(pkg-config --libs gtk+-3.0) | |
*/ | |
#include <gtk/gtk.h> | |
int main (int argc, char *argv[]) | |
{ | |
gtk_init (&argc, &argv); | |
if (argc <= 1) { | |
g_print ("Please inform the icon name\n"); | |
return 1; | |
} | |
GtkIconTheme *theme = gtk_icon_theme_get_default (); | |
GtkIconInfo *info = gtk_icon_theme_lookup_icon (theme, argv[1], 32, 0); | |
if (info == NULL) { | |
g_print ("Icon '%s' not found\n", argv[1]); | |
} else { | |
g_print ("%s\n", gtk_icon_info_get_filename (info)); | |
g_object_unref (info); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment