--- WindowMaker-0.80.1/src/main.c.nousrscrpt 2002-03-26 13:47:12 +0300 +++ WindowMaker-0.80.1/src/main.c 2002-07-23 18:43:30 +0400 @@ -490,28 +490,39 @@ wfree(path); } - static void execInitScript() { char *file; - char *paths = wstrconcat(wusergnusteppath(), ":"DEF_CONFIG_PATHS); - - file = wfindfile(paths, DEF_INIT_SCRIPT); - wfree(paths); - if (file) { - if (system(file) != 0) { - wsyserror(_("%s:could not execute initialization script"), file); - } + if (wPreferences.execute_system_scripts) + { + file = wfindfile(DEF_SYSTEMSCRIPTS_PATHS, DEF_INIT_SCRIPT); + if (file) { + if (system(file) != 0) { + wsyserror(_("%s:could not execute initialization script"), file); + } #if 0 - if (fork()==0) { - execl("/bin/sh", "/bin/sh", "-c", file, NULL); - wsyserror(_("%s:could not execute initialization script"), file); - exit(1); - } + if (fork()==0) { + execl("/bin/sh", "/bin/sh", "-c", file, NULL); + wsyserror(_("%s:could not execute initialization script"), file); + exit(1); + } #endif - wfree(file); + wfree(file); + } + } + if (wPreferences.execute_user_scripts) + { + char *paths = wstrconcat(wusergnusteppath(), ":"DEF_USERSCRIPTS_PATHS); + file = wfindfile(paths, DEF_INIT_SCRIPT); + wfree(paths); + if (file) { + if(system(file) != 0) { + wsyserror(_("%s:could not execute initialization script"), file); + } + wfree(file); + } } } @@ -520,23 +531,36 @@ ExecExitScript() { char *file; - char *paths = wstrconcat(wusergnusteppath(), ":"DEF_CONFIG_PATHS); - file = wfindfile(paths, DEF_EXIT_SCRIPT); - wfree(paths); - - if (file) { - if (system(file) != 0) { - wsyserror(_("%s:could not execute exit script"), file); - } + if (wPreferences.execute_system_scripts) + { + file = wfindfile(DEF_SYSTEMSCRIPTS_PATHS, DEF_EXIT_SCRIPT); + if (file) { + if (system(file) != 0) { + wsyserror(_("%s:could not execute exit script"), file); + } #if 0 - if (fork()==0) { - execl("/bin/sh", "/bin/sh", "-c", file, NULL); - wsyserror(_("%s:could not execute exit script"), file); - exit(1); - } + if (fork()==0) { + execl("/bin/sh", "/bin/sh", "-c", file, NULL); + wsyserror(_("%s:could not execute exit script"), file); + exit(1); + } #endif - wfree(file); + wfree(file); + } + } + + if (wPreferences.execute_user_scripts) + { + char *paths = wstrconcat(wusergnusteppath(), ":"DEF_USERSCRIPTS_PATHS); + file = wfindfile(paths, DEF_EXIT_SCRIPT); + wfree(paths); + if (file) { + if(system(file) != 0) { + wsyserror(_("%s:could not execute initialization script"), file); + } + wfree(file); + } } } --- WindowMaker-0.80.1/src/defaults.c.nousrscrpt 2002-07-23 18:39:01 +0400 +++ WindowMaker-0.80.1/src/defaults.c 2002-07-23 18:39:01 +0400 @@ -551,6 +551,12 @@ {"SingleClickLaunch", "NO", NULL, &wPreferences.single_click, getBool, NULL }, + {"ExecuteUserScripts", "YES", NULL, + &wPreferences.execute_user_scripts, getBool, NULL + }, + {"ExecuteSystemScripts", "YES", NULL, + &wPreferences.execute_system_scripts, getBool, NULL + }, /* style options */ {"MenuStyle", "normal", seMenuStyles, &wPreferences.menu_style, getEnum, setMenuStyle --- WindowMaker-0.80.1/src/WindowMaker.h.nousrscrpt 2002-07-23 18:39:01 +0400 +++ WindowMaker-0.80.1/src/WindowMaker.h 2002-07-23 18:39:01 +0400 @@ -467,6 +467,10 @@ /* single click to lauch applications */ int single_click; + int execute_user_scripts; + + int execute_system_scripts; + int edge_resistance; char attract; --- WindowMaker-0.80.1/src/wconfig.h.in.nousrscrpt 2002-01-08 16:45:33 +0300 +++ WindowMaker-0.80.1/src/wconfig.h.in 2002-07-23 18:40:59 +0400 @@ -231,6 +231,12 @@ #define DEF_CONFIG_PATHS \ "~/GNUstep/Library/WindowMaker:"PKGDATADIR +#define DEF_SYSTEMSCRIPTS_PATHS \ +PKGDATADIR + +#define DEF_USERSCRIPTS_PATHS \ +"~/GNUstep/Library/WindowMaker" + #define DEF_MENU_FILE "menu" /* name of the script to execute at startup */