// This function is now implemented in ede-launch void MainMenu::resolve_program(Fl_String cmd) { char pRun[FL_PATH_MAX]; snprintf(pRun, sizeof(pRun)-1, "ede-launch \"%s\"", cmd.c_str()); fl_start_child_process(pRun, false); }
static void LaunchApp(char *name) { Fl_Config conf(fl_find_config_file("wmanager.conf", false)); Fl_String app; conf.get("Applications", name, app, NULL); if(! app.empty()) fl_start_child_process(app, false); }
// Start utility, like "time/date" or "volume" void startUtility(Fl_Button *, void *pName) { Fl_String value; pGlobalConfig.get("Panel", (char*)pName, value, ""); if(!pGlobalConfig.error() && !value.empty()) { value = "ede-launch \""+value; value += "\""; fl_start_child_process(value, false); } }
void apply_colors_apps(Fl_Color fg, Fl_Color bg, Fl_Color text, Fl_String font) { uchar r, g, b, r1, g1, b1, r2, g2, b2; fl_get_color(bg, r, g, b); fl_get_color(fg, r1, g1, b1); fl_get_color(text, r2, g2, b2); Fl_String filePath(fl_homedir()); filePath += "/.Xdefaults"; char *backgroundTypes[34] = { "*XmList.background" , "*XmLGrid.background", "Netscape*XmList.background" , "Netscape*XmLGrid.background", "*text*background", "*list*background", "*Text*background", "*List*background", "*textBackground", "*XmTextField.background", "*XmText.background", "Netscape*XmTextField.background", "Netscape*XmText.background", "*background", "*Background", "nscal*Background", "*Menu*background", "OpenWindows*WindowColor", "Window.Color.Background", "netscape*background", "Netscape*background", ".netscape*background", "Ddd*background", "Emacs*Background", "Emacs*backgroundToolBarColor",//25 "*XmList.selectBackground" , "*XmLGrid.selectBackground", "Netscape*XmList.selectBackground" , "Netscape*XmLGrid.selectBackground", "*XmTextField.selectBackground", "*XmText.selectBackground", "Netscape*XmTextField.selectBackground", "Netscape*XmText.selectBackground", "*selectBackground" //34 }; FILE *colorFile = fopen(filePath, "w"); for (int i = 0 ; i < 34; i++) { fprintf(colorFile, "%s: #%02X%02X%02X\n", backgroundTypes[i],(short int) r, (short int) g, (short int) b); } fprintf(colorFile, "foreground: #%02X%02X%02X\n", r1, g1, b1); fprintf(colorFile, "xterm*background: #FFFFFF\n"); //especialy for Xterm fclose(colorFile); Fl_String runString("xrdb -merge -all "); runString += fl_homedir(); runString += "/.Xdefaults"; if (fl_start_child_process(runString)==-1) fl_alert("Error executing xrdb program."); }
void Icon::cb_execute_i() { Fl_Config &iconfig = *cfg; iconfig.set_section("Desktop Entry"); char *cmd=0; if(!iconfig.read("Exec", cmd, 0) && cmd) { char pRun[256]; char browser[256]; Fl_Config pGlobalConfig(fl_find_config_file("ede.conf", 0)); pGlobalConfig.get("Web", "Browser", browser, 0, sizeof(browser)); if(pGlobalConfig.error() && !browser) { strncpy(browser, "netscape", sizeof(browser)); } char *location = cmd; char *prefix = strstr(location, ":"); if(prefix) // it is internet resource { *prefix = '\0'; if (!strcasecmp(location, "http") || !strcasecmp(location, "ftp") || !strcasecmp(location, "file")) { snprintf(pRun, sizeof(pRun)-1, "%s %s &", browser, cmd); } else if (!strcasecmp(location, "gg")) { snprintf(pRun, sizeof(pRun)-1, "%s http://www.google.com/search?q=\"%s\" &", browser, ++prefix); } else if (!strcasecmp(location, "leo")) { snprintf(pRun, sizeof(pRun)-1, "%s http://dict.leo.org/?search=\"%s\" &", browser, ++prefix); } else if (!strcasecmp(location, "av")) { snprintf(pRun, sizeof(pRun)-1, "%s http://www.altavista.com/sites/search/web?q=\"%s\" &", browser, ++prefix); } else { snprintf(pRun, sizeof(pRun)-1, "%s %s &", browser, cmd); } } else // local executable { snprintf(pRun, sizeof(pRun)-1, "%s &", cmd); } fl_start_child_process(pRun); free((char*)cmd); } }
void cb_run_app(Fl_Input *i, void*) { Fl_String exec(i->value()); if ((exec == "") || (exec == " ")) return; exec = "ede-launch \""+exec; exec += "\""; fl_start_child_process(exec, false); Fl_Input_Browser *ib = (Fl_Input_Browser *)i->parent(); if (!ib->find(i->value())) { ib->add(i->value()); Fl_String_List history; int c = 0; if (ib->children() > 15) c = ib->children() - 15; for (; c < ib->children(); c++) { history.append(ib->child(c)->label()); } pGlobalConfig.set("Panel", "RunHistory", history.to_string("|")); pGlobalConfig.flush(); } i->value(""); }
/** * cb_button - Button callback * @button: The button * @data: button data (command for exec) * * This function is the button callback function and executes the * specified command with the 'system()' call. */ static void cb_qlb_taskbutton(Fl_Button *button, void *data) { fl_start_child_process((char *)data, false); }
void runUtility(Fl_Widget *, char *pCommand) { char cmd[256]; snprintf (cmd, sizeof(cmd)-1, "ede-launch %s", pCommand); fl_start_child_process(cmd, false); }
void icons_properties(Fl_Widget *, void *arg) { fl_start_child_process("eiconsconf &"); }
static void FindUtil(char *name) { fl_start_child_process("efinder",false); }
static void FastRun(char *name) { fl_start_child_process("elauncher",false); }