C Prog to change wallpaper in every 30 seconds.

I wrote a good length of description on the below but somehow my browser closed without saving that. So I am just putting the program below:


int main(int argc, char ** argv)
DIR *dp;
struct dirent *ep;
char dirname[80];
GConfClient* client;
int s;

if (argc<=1)
printf(\”%d is argc\\n\”, argc);
fflush (stdout);
dp = opendir(\”.\”);
strcpy(dirname, \”.\”);
dp = opendir(argv[1]);
strcpy(dirname, argv[1]);
if (argc <=2 )
s = 30;
else if ( argc >2 ) s = atoi(argv[2]);
client = gconf_client_get_default();
//client = gconf_client_get_for_engine (gconf_engine_get_default());

if (dp != NULL)
while (ep = readdir (dp))
char buffer[80];
//printf(\”%s \\n\”,buffer);
if (ep->d_type == 8) {
sprintf(buffer, \”%s/%s\”, dirname, ep->d_name);
printf(\”%s \\n\”,buffer);
//gconf_client_suggest_sync(client, NULL);
// else if (ep->d_type == DT_DIR) main(1, ep->d_name);
perror (\”Could not open directory\”);

return 0;

2 thoughts on “C Prog to change wallpaper in every 30 seconds.”

  1. i am executed the above program in gcc compiler, but i get following errors, please give me suggestion & how to get GConf libraray.
    error:‘GConfClient’ undeclared (first use in this function)
    error: (Each undeclared identifier is reported only once
    error: for each function it appears in.)
    13: error: ‘client’ undeclared (first use in this function)

This site uses Akismet to reduce spam. Learn how your comment data is processed.