C Prog to change wallpaper in every 30 seconds.

2009-12-08 154 words 1 min read

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:

#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <gconf/gconf-client.h>

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

if (argc<=1)
printf(&#8221;%d is argc\n&#8221;, argc);
fflush (stdout);
dp = opendir(&#8221;.&#8221;);
strcpy(dirname, &#8221;.&#8221;);
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(&#8221;%s \n&#8221;,buffer);
if (ep->d_type == 8) {
sprintf(buffer, &#8221;%s/%s&#8221;, dirname, ep->d_name);
printf(&#8221;%s \n&#8221;,buffer);
//gconf_client_suggest_sync(client, NULL);
// else if (ep->d_type == DT_DIR) main(1, ep->d_name);
perror (&#8221;Could not open directory&#8221;);

return 0;

Tags: Gnome

Related Articles:


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it